Click here to Skip to main content
15,905,073 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to update data into back-end using dataview
Please tell me soon ..
Posted

1 solution

try this..
DataView can be used to modify the actual content in a DataTable.It means adding new rows, sorting and search a table.
con.Open();
       string query = "select * from tab2";
       SqlDataAdapter da = new SqlDataAdapter(query, con);
       con.Close();
       DataSet ds = new DataSet();
       DataView dv = new DataView();
       da.Fill(ds);
       dv = new DataView(ds.Tables[0],"", "name", DataViewRowState.CurrentRows);
       int index = dv.Find("ddd");

       if (index == -1)
       {
       }
       else
       {
           dv[index]["name"] = "aaa";
       }

       grdview.DataSource = (DataTable)dv.ToTable();
       grdview.DataBind();
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900