Yes Monika
That is possible, but in case of DataView. But no need to worry, you can easily convert the DataSet to DataView and then use the RowFilter property of DataView, code example is below:
private void BindGrid()
{
SqlConnection sConn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
string sQuery = "select * from TestTable";
SqlDataAdapter da = new SqlDataAdapter(sQuery,sConn);
DataSet ds = new DataSet();
da.Fill(ds);
//HERE WE CONVERT DATASET TO DATAVIEW
ds.Tables[0].DefaultView.RowFilter = "ProjectID = '1'";
//AND BIND THE GRID WITH TABLE[0]'S VIEW
dg.DataSource = ds.Tables[0].DefaultView;
dg.DataBind();
}
Regards
Mike
|