Visual Basic - Datagrid

Life is soft - evento anual de software empresarial
 
Vista:

Datagrid

Publicado por Balu (5 intervenciones) el 06/08/2004 19:44:44
Necesito almacenar renglon por renglon el contenido de un datagrid como registros independientes en una tabla ¿como le puedo hacer?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Datagrid

Publicado por tecniCam (186 intervenciones) el 06/08/2004 23:23:33
Fíjate en esto y haz algo parecido pero nop para formatear sino para extraer el contenido:
Dim ifor As Integer
Dim jFor As Integer
Dim Filas_Consulta As Integer
Dim i As Integer
Filas_Consulta = msh.Rows - 1
prog1.Min = 1
prog1.Max = (msh.Rows) * (msh.Cols) + 1
prog1.Value = 1
msh3.Visible = False
With msh
msh0.Visible = False
.ColWidth(0) = 3900
.ColWidth(1) = 2500
.ColWidth(2) = 1000
.ColWidth(4) = 1300
.ColWidth(5) = 1300
.ColWidth(3) = 1400
.Width = 11630
.Height = 3480 - 200
.Left = (Me.Width \ 2) - (.Width \ 2)
.Row = 0
.col = 0
.CellFontBold = True
'.Row = auxRow
For ifor = 0 To .Rows - 1
For jFor = 1 To .Cols - 1
.Row = ifor
.col = jFor
.CellAlignment = 6
.CellFontBold = True
'If InStr(1, .Text, ",") <> 0 Then
If porcentaje Then
.Text = Format(.Text, "#,##0.00")
ElseIf porcentaje1 Then
.Text = Format(.Text, "#,##0.000")
Else
.Text = Format(.Text, "#,##0")
End If
'End If
prog1.Value = prog1.Value + 1
Next
Next
End With
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Datagrid

Publicado por tecniCam (186 intervenciones) el 06/08/2004 23:24:55

Si tuvieras el MSDN no estarias buscando soluciones, entra en:
http://usuarios.lycos.es/coarte y lo obtendrás.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Datagrid

Publicado por Evelyn (12 intervenciones) el 07/08/2004 00:25:42
No No tecniCam te equivocas el habla de DATAGRID no MSH
eso que dices BALU seria algo asi por ejemplo:

Dim sSql as string , sColumna1 as string ,sColumna2 as string

DO WHILE DataGrid1.Row <= DataGrid1.ApproxCount
sColumna1 = DataGrid1.Columns.Item(0).Value
sColumna2 = DataGrid1.Columns.Item(1).Value
ssql = "INSERT INTO Tabla (Nombre,Apellidos) VALUES ('" &
sColumna1 & "','" & sColumna2 & "')"
CN.Execute ssql
DataGrid1.Row = DataGrid1.Row + 1
LOOP

Ahora pruebalo escribe si pasa algo... bye
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar