Try
myconn = New SqlConnection(My.Settings.testsettings)
myconn.Open()
mycmd = New SqlCommand("select * from test1", myconn)
dr = mycmd.ExecuteReader
While dr.Read
ComboBox1.Items.Add(dr("fname"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message, "cbox")
End Try
myconn.Close()
mycmd.Dispose()
dr.Close()
No comments:
Post a Comment