Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click
Datagrid Is Doubling each click Datagrid Is Doubling each click
Datagrid Is Doubling each click
Go Back  Xtreme Visual Basic Talk > > > Datagrid Is Doubling each click


Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2014, 10:48 PM
KenDiener KenDiener is offline
Newcomer
 
Join Date: Apr 2008
Posts: 7
Default Datagrid Is Doubling each click


I am new and can't figure where the problem is in my code. Please help. On the button click, my datagridview doubles every time. Here is my code:
Code:
 MysqlConn = New MySqlConnection
        MysqlConn.ConnectionString = "Data Source=localhost;Database=bridgemore;User ID=root;Password=kt021404;"
        Dim SDA As New MySqlDataAdapter
        'Dim dbddataset As New DataTable
        Dim bSource As New BindingSource

        Try

            MysqlConn.Open()
            Dim Query As String
            Query = "select * from bridgemore.clientsinfo"
            COMMAND = New MySqlCommand(Query, MysqlConn)
            SDA.SelectCommand = COMMAND
            SDA.Fill(dbdataset)
            bSource.DataSource = dbdataset
            DataGridView1.DataSource = bSource
            SDA.Update(dbdataset)

            SDA.Fill(dbdataset)

            MysqlConn.Close()
        Catch ex As MySqlException
            MessageBox.Show(ex.Message)
        Finally
            MysqlConn.Dispose()

        End Try

Last edited by Cerian Knight; 08-24-2014 at 11:06 PM. Reason: Added [code]...[/code] tags
Reply With Quote
  #2  
Old 08-25-2014, 04:31 PM
KenDiener KenDiener is offline
Newcomer
 
Join Date: Apr 2008
Posts: 7
Default

Any takers? This is killing me.
Reply With Quote
  #3  
Old 08-27-2014, 05:00 PM
iwrbcam iwrbcam is offline
Newcomer
 
Join Date: Aug 2014
Posts: 3
Default DataGrid Doubling

Looks like you have the "Fill" in there twice.

MysqlConn.Open()
Dim Query As String
Query = "select * from bridgemore.clientsinfo"
COMMAND = New MySqlCommand(Query, MysqlConn)
SDA.SelectCommand = COMMAND
HERE>> SDA.Fill(dbdataset)
bSource.DataSource = dbdataset
DataGridView1.DataSource = bSource
SDA.Update(dbdataset)

AND HERE >>SDA.Fill(dbdataset)
Reply With Quote
  #4  
Old 08-28-2014, 03:58 AM
Bashirahmad Bashirahmad is offline
Newcomer
 
Join Date: Feb 2013
Location: kashmir
Posts: 15
Default

Dear sir

U can solve the problem by inserting SDA.clear before the line SDA.Fill(dbdataset)


hope it helps


Bashir ahmad
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click Datagrid Is Doubling each click
Datagrid Is Doubling each click
Datagrid Is Doubling each click
 
Datagrid Is Doubling each click
Datagrid Is Doubling each click
 
-->