在Datagridview中复制值

时间:2016-02-05 14:26:19

标签: mysql vb.net datagridview

我通过Selected行向Mysqldb插入值。插入Mysqldb是成功的

问题:当我将我在mysqldb中插入的值加载到另一个Datagridview中时,值是重复9x。但是当我在Mysql数据库中检查它时,它不会复制。

     Dim MysqlConn3 As New MySqlConnection
    MysqlConn3.ConnectionString = "server=localhost;userid=root;password=Gaezlevister214;database=librarydb;"
    Dim command3 As New MySqlCommand
    Dim SDA3 As New MySqlDataAdapter
    Dim bSource3 As New BindingSource
    Dim dbDataSet3 As New DataTable
    Try
        MysqlConn3.Open()
        Dim Query3 As String
        Query3 = "Select blist.quantity as 'Qty', returnedlist.student_id as 'Student ID', returnedlist.call_number as 'Call_Number',returnedlist.date_added as 'Date Borrowed',returnedlist.due_date as 'Due Date' from librarydb.returnedlist, librarydb.blist"
        command3 = New MySqlCommand(Query3, MysqlConn3)
        SDA3.SelectCommand = command3
        SDA3.Fill(dbDataSet3)
        bSource3.DataSource = dbDataSet3
        Me.DataGridView1.DataSource = bSource3
        SDA3.Update(dbDataSet3)

    Catch ex As MySqlException
        MessageBox.Show(ex.Message)
    Finally

        MysqlConn3.Close()
    End Try

0 个答案:

没有答案