posts - 9,  comments - 0,  trackbacks - 0

  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)  编辑 收藏 引用
只有注册用户登录后才能发表评论。

<2006年11月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

常用链接

留言簿(1)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜