[求助]gridview代码连接数据库应该怎么做?
Dim constr As String = "uid=sa;pwd=123;database=infomation;server=W8DJHYLNJCL4ZIW"
Dim con As New SqlConnection(constr)
Dim cmdstr As String = "select id,name,org from detail"
Dim ada As New SqlDataAdapter(cmdstr, con)
Dim ds As New DataSet
con.Open()
ada.Fill(ds, "detail")
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
这些代码正确吗?我运行之后,gridview没有显示出来,请问是什么原因?