Private Sub SQLM()
Dim myconn As String = "server=(local);UID=sa;PWD=123456; database=tj"
SqlConnection1 = New SqlClient.SqlConnection(myconn)
'sqlCommand1 = New System.Data.SqlClient.SqlCommand(queryString, sqlConnection)
SqlDataAdapter1 = New SqlClient.SqlDataAdapter("select 分类1,id from 通信录1", SqlConnection1)
SqlDataAdapter1.Fill(DSLIST11, "通信录1")
DataGridView1.DataSource = DSLIST11.Tables(0)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'OleDbDataAdapter1.SelectCommand = New OleDb.OleDbCommand("select top 5 * from 通信录1", OleDbConnection1)
SqlDataAdapter1.SelectCommand = New SqlClient.SqlCommand("select top 5 * from 通信录1", SqlConnection1)
DSLIST11.Clear()
SqlDataAdapter1.Fill(DSLIST11, "通信录1")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call SQLM()
End Sub
posted on 2006-11-19 18:06
MT'S BLOG 阅读(163)
评论(0) 编辑 收藏 引用