Hi, I want to search the dataview with a particular value,retrieve it and show it in a datagrid but its not searching appropriately. I am pasting the code for u to see....
string connstr = "Data Source=Akiii-PC;Initial Catalog=rgdb;User Id = sa;password = 12345";
SqlConnection conn = new SqlConnection(connstr);
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
cmd = new SqlCommand("select * from reg_table", conn);
sda.SelectCommand = cmd;
dv = new DataView(ds.Tables);
dv.Sort = "name";
int index = dv.Find("12333");
if(index == -1)
GridView1.DataSource = dv;
//Response.Write(dv[index]["Product_id"].ToString() + " " + dv[index]["Product_Name"].ToString());
catch (Exception ex)
12333 is the value that i want to search in the dataview which has been populated by dataset but it cannot find any result.
Please help me on this.....
Am i doing something wrong here...?
Thanks and Regards