Question VS10 - Refresh datasource/dataset after changes to SQL table structure?

ccbryan

Active member
Joined
Oct 14, 2008
Messages
30
Programming Experience
5-10
Hi...

I have a VB.NET project (VS10) in which I have created a "Datasource" that connects to a remote SQL database via a connection string. I have used this Datasource to build several forms with Datagridviews. Now the structure of some tables in the SQL database has changed (new fields), but I can't figure out how to refresh the Datasource in my project so those changes are visible.

So, how can I see the new fields in my VB.NET project??

Thanks for any ideas...
 
Just Re Fill the DB and Re Bind it again

refresh the datasource of datagridview

dataGridView1.Refresh
dataGridView1.Parent.Refresh
 
Figured it out, thanks

The problem I think was that I didn't know how to update my data schema. I figured out how to do that by viewing the schema graphically and clicking "configure" on each table and editing its SQL. Seems like there should be an easier way to do that, but I got it done. Thanks for the suggestion though!

Chandler
 
There's a button in the tool bar at the top of the Data Sources window to re-run the configuration wizard that you used to create the Data Source in the first place. It will handle most changes but if you find something that it doesn't handle properly, simply delete the DataTable/TableAdapter in the DataSet designer and then run the wizard to add it again.
 
Back
Top