R
Rafael Metring
How set DAtaTextField and DataValueField in dropdOwnlist
I use this to populate..
Dim sqlConn As SqlCeConnection = Nothing
Dim dr As SqlCeDataReader
Dim da As SqlCeDataAdapter
Dim ds As DataSet = New DataSet
Dim strsql As String
Try
sqlConn = New SqlCeConnection("Data Source =\My Documents\multiseguros.sdf")
Dim insertCommand As SqlCeCommand = sqlConn.CreateCommand()
strsql = "select * from Produto"
sqlConn.Open()
da = New SqlCeDataAdapter(strsql, sqlConn)
da.Fill(ds)
lstProduto.DataSource = ds.Tables(0).DefaultView
lstProduto.Refresh()
Catch err As SqlCeException
MessageBox.Show(err.Message)
Finally
If sqlConn.State = ConnectionState.Open Then
sqlConn.Close()
End If
End Try
I use this to populate..
Dim sqlConn As SqlCeConnection = Nothing
Dim dr As SqlCeDataReader
Dim da As SqlCeDataAdapter
Dim ds As DataSet = New DataSet
Dim strsql As String
Try
sqlConn = New SqlCeConnection("Data Source =\My Documents\multiseguros.sdf")
Dim insertCommand As SqlCeCommand = sqlConn.CreateCommand()
strsql = "select * from Produto"
sqlConn.Open()
da = New SqlCeDataAdapter(strsql, sqlConn)
da.Fill(ds)
lstProduto.DataSource = ds.Tables(0).DefaultView
lstProduto.Refresh()
Catch err As SqlCeException
MessageBox.Show(err.Message)
Finally
If sqlConn.State = ConnectionState.Open Then
sqlConn.Close()
End If
End Try