Apply Changes to the Database

2 posts, 0 answers
  1. Rasha
    Rasha avatar
    4 posts
    Member since:
    Apr 2013

    Posted 09 May 2013 Link to this post

    Hey guys,
    Could you please help me with this example 
    http://www.telerik.com/help/aspnet-ajax/listview-manual-editing.html

    how can I update the database using the data table in the example, please reply...
    Thanks, 
    Rasha
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 May 2013 Link to this post

    Hi Rasha,

    Try the following.
    C#:
           SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ToString());
         string name=changedRows[0][columnname].ToString();
         con.Open();
         string updateQuery="update tblename set name='"+name+"' where ProductID=changedRows[0][ProductID].Tostring()";//to update;
          SqlCommand cmd = new SqlCommand(updateQuery, con);
          cmd.ExecuteNonQuery();
          con.Close();

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top