Community discussion forum

Editing or updating a column in a data table

  • 1 year ago

    Hi! guys. Sad  How do I update the datatable with a new value? Sad 

    using
    (SqlDataAdapter da = new SqlDataAdapter(sql, sqlConn)){

    da.Fill(dt);

    dt.Columns["outgoing"].ToString()= DateValue1;

    dt.Columns["ingoing"].ToString()= DateValue2;

     

    dt.AcceptChanges();

     

    }

  • 1 year ago

    is the value taken from a textbox or other control ? if you want to set the value manually, the SQL command for updating value is given below:

    string sqlStmt;

    sqlStmt= "UPDATE table_name SET column_name= value WHERE column_name=value";

    for e.g. if you want the value of employee_number column to 2 where employee_telephone is 3 in employee table...then

    sqlStmt= "UPDATE employee SET employee_number= 2 WHERE employee_telephone=3";

  • 1 year ago

    Yah! Cool, but i was looking for something like this 

    DataRow[] Row = dt.Select("outgoing '"= txtid.Text +"'" );

    Row[0]["AllowAccess"] = chkperm.CheckState ;

    dt.AcceptChanges();

  • 1 year ago
    Hi, I am facing problem to pass string value from first aspx page to second aspx page pls help me how we pass this value Ashok 09415818455
  • 1 year ago
    check out the following link maybe it will help you: http://authors.aspalliance.com/kenc/passval.aspx also, try searching in google, you will find a lot of answers there. you may search "passing value from one aspx page to another"

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!