请帮忙看一下,代码借在哪里!百思不得解啊,关于VB连接SQL数据库的问题
Dim objConnection As New SqlConnection("Server=localhost;database=student;user=sa;password=123456")Dim objDataAdapter As New SqlDataAdapter()
Dim objDataSet As New DataSet()
Private Sub Form1_Click(sender As Object, e As EventArgs) Handles Me.Click
objDataAdapter.SelectCommand = New SqlCommand()
objDataAdapter.SelectCommand.Connection = objConnection
objDataAdapter. = CommandType.Text
objDataAdapter. = "select * from st_information"
objConnection.Open()
objDataAdapter.Fill(objDataSet, "st_information")
objConnection.Close()
grdStudent.AutoGenerateColumns = True
grdStudent.DataSource = objDataSet
grdStudent.DataMember = "student information"
objDataAdapter = Nothing
objDataSet = Nothing
End Sub