Development language: vb
Protected Sub Buton1_Click (sender As Object, As EventArgs e) Handles for. Click
Dim the rs AS the ADODB library you
Rs=New ADODB. You
Rs. The ActiveConnection="Provider=SQLOLEDB. 1; Password=132; Persist Security Info=True; User ID=sa; Initial Catalog=db_news; The Data Source=WIN - 3 l70iqhfnql
"Rs. CursorLocation=ADODB. CursorLocationEnum. AdUseClient
Rs. The CursorType=ADODB. CursorTypeEnum. AdOpenStatic
Rs. The Source="select userid, UserName from td_user order by id"
Rs. The Open ()
GridView1.
the DataSource=rs
CodePudding user response:
Good less people use ADOCodePudding user response:
Rs. The ActiveConnection should be a Connection object, not the string , the other the GridView can bind you? Let's use the DataSet or the DataTableCodePudding user response:
The error information is insufficient, can't screen what reason!