Problem with datagridview showing DB data changes

TyB

Well-known member
Joined
May 14, 2009
Messages
102
Programming Experience
3-5
I am building my first Winform that uses a datagridview. I have used the ASP.Net gridview with the sqldatasource control many times.

Here is the setup.
I have a SQL DB file. I program adds data to the db. I have a link on my main form that shows my second form which has 3 datagridviews. Now when I show the form the first time is shows that data in the db tables however; if I add data to the db on the main form then open the second form it does not show the new data. It is still the data that was in the table when the applications was first loaded.

I guess that I have to manually refresh the data but I cannot see how to do that. In ASP.net I could do it like this.
SqlDataSource1.DataBind()

GridView1.DataBind()
Any way to do this in win form? I cannot find a databind for the dataset or datagridview.

Thanks,
Tyler
 
Back
Top