Dim con As New SqlClient.SqlConnection("server=.;database=jxxjglxt;uid=aha;pwd=123")
'Dim con As New SqlClient.SqlConnection("server='"+textBox1.text.toString()+"';database=********")
con.Open()
Dim com As New SqlClient.SqlCommand("select * from User_Info", con)
Dim da As New SqlClient.SqlDataAdapter(com)
Dim ds As New DataSet
da.Fill(ds)
Me.DataGridView1.DataSource = ds.Tables(0)
干嘛这么复杂呀,传参数就用第二种连接语句.