Hi All, I have a WIndows App with a datagridview which selects a sql select command from sql server and display the rows in a datagridview. i have a refresh button which redraws the grid and recalls the sql statement however, leaving the win app on a whole day i notice when i click on the refresh it's not giving me the same query result if i were to enter the query in the sql server query?
////code////
public void draw_grid()
{
string strconn="the.connection.string";
string sqlstring="Select * From WorkOrder";
SqlDataAdapter da = new SqlDataAdapter(sqlstring,strconn);
DataSet ds = new DataSet();
da.Fill(ds,"DataGrid");
DataTable DT = ds.Tables[0];
DT.TableName="DataGridTable";
}
so each time i click refresh i'm calling draw_grid();
example if my sql table (WOrk Order) has 10 rows when i load up the win app the datagridview will load up 10 rows and let's say after 1 day 3 new rows has been created in the (work ORder) table to have a total of 13 rows if i click on refresh to redaw the datagrid it will only show 10 rows.
ANy Idea any one???
////code////
public void draw_grid()
{
string strconn="the.connection.string";
string sqlstring="Select * From WorkOrder";
SqlDataAdapter da = new SqlDataAdapter(sqlstring,strconn);
DataSet ds = new DataSet();
da.Fill(ds,"DataGrid");
DataTable DT = ds.Tables[0];
DT.TableName="DataGridTable";
}
so each time i click refresh i'm calling draw_grid();
example if my sql table (WOrk Order) has 10 rows when i load up the win app the datagridview will load up 10 rows and let's say after 1 day 3 new rows has been created in the (work ORder) table to have a total of 13 rows if i click on refresh to redaw the datagrid it will only show 10 rows.
ANy Idea any one???