Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataBase Bind DataGridView Not showing most updated Data

Status
Not open for further replies.

jl3574

Programmer
Jun 5, 2003
76
0
0
CA
Hello All, i created a datagridview using sqldataadapter and a dataset. when there is a change inthe database, i created a refresh button so the datagridview can reload the data to show the updated datbase. This work good and all but the application doesn't get restarted much so after like 2 days the datagridview no longer shows the most updated data even when i'm re-clicking my refresh button.

the application is meant not to be restarted on a daily bases.

///////////////
string sql="Select * from Table.....";
SqlDataAdapter da = new SqlDataAdapter(sql,connectionstring);
DataSet ds = new DataSet();
da.Fill(ds,"TableName");
DataTable DT1 = ds.Table[0];
DataGridView1.DataSource=ds.Tables["TableName"];
 
I am create a window based app i beleive datagridview does not support DataGridView.DataBind(); as it only exist in the web based app.


i am just using DataGridView.DataSource=(dataSet).Table

if you have another suggest for a better way for bindingdata with datagridview please do.. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top