Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
loading mysql to datagridview, datagridview became double
obulisundaram G
Oct 29 2013 5:18 AM
782
Reply
Hi,
I am using mysql and datagridview for storing and retrieving purpose., I just done saving the data from datagridview to mysql. But while I'm loading mysql into again that same datagridview, the datagridview become twice.
I given the code below
private void btnload_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
string st = "select * from searchsong";
MySqlDataAdapter ad = new MySqlDataAdapter(st, con);
MySqlCommandBuilder cmd = new MySqlCommandBuilder(ad);
ad.Fill(dt);
BindingSource bg = new BindingSource();
bg.DataSource = dt;
dataGridView1.DataSource = bg;
}
In this "con"- connection string and "searchsong" is table name.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
remove errors from this C language code ?
find an replace a particular character with another in strin