如何用控件做呢,我在dataGrid写入数据,写入的数据可以插入到数据库里,而用textBox就不行,我已经把textBox与dataset绑定了,是什么原因,还是不可以用控件,只能用代码写?
请帮帮忙!很急!

解决方案 »

  1.   

    reference:
    http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c43c.aspx#q1017q
      

  2.   

    DataTable dt;
    dt = ds.Tables["table"];
    DataRow drCurrent;
    // Obtain a new DataRow object from the DataTable.
    drCurrent = dt.NewRow();
    drCurrent["column"] = columnvalue;
    // Pass that new object into the Add method of the DataTable.
    dt.Rows.Add(drCurrent);

    // BEGIN SEND CHANGES TO SQL SERVER 
    SqlCommandBuilder objCommandBuilder = new SqlCommandBuilder(da);
    da.Update(ds, "table");