16,554
社区成员
发帖
与我相关
我的任务
分享
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As SqlConnection = New SqlConnection("Data Source=CONAN-PC\SQLExpress; AttachDbFilename=D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\libry.mdf; Integrated Security= True; Initial Catalog=libry; Connect Timeout=30; User Instance= True")
Dim adapter As SqlDataAdapter
Dim ds As New DataSet
try
conn.open
adapter = new sqldataAdapter("select * from xxx",conn)
adapter.fill(ds)
catch ex
msgbox ex.message.tostring
end try
End Sub