1 Public Sub connect()
2 Dim conn As New SqlClient.SqlConnection("driver={SQL Server};server=PC-201105311336\SQLEXPRESS;Uid=sa;Pwd=123456;Database=jiaxiaoai")
3 Dim myDataSet As New DataSet
4 Dim sql As String
5 sql = "select * from student"
6 Dim rs As SqlClient.SqlDataAdapter
7 With rs.SelectCommand
8 .CommandText = sql
9 .CommandType = CommandType.Text
10 .Connection = conn
11 End With
12 rs.Fill(myDataSet, "student")'表student填充到dataset中
13 conn.Close()
14 End Sub

相关文章:

  • 2022-12-23
  • 2022-02-01
  • 2021-09-17
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-15
  • 2021-07-09
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
相关资源
相似解决方案