怎麼將輸入框控件中的值添加到DataSet中?
//前兩個是將textbox中的值添加到dataset中 ds.Tables[0].Rows[0]["數據庫中與輸入框對應的列名"] = textBox_bh.Text; ds.Tables[0].Rows[0]["數據庫中與輸入框對應的列名"] = textBox_mc.Text; //將checkedit的選擇與否的狀態添加到dataset中去,checkedit_a與checkedit_b是checkedit控件的name ds.Tables[0].Rows[0]["數據庫中與輸入框對應的列名"] = checkedit_a.CheckState; ds.Tables[0].Rows[0]["數據庫中與輸入框對應的列名"] =checkedit_b.CheckState; //將上麵輸入的值顯示到gridcontrol上 gridControl1.DataSource = ds.Tables[0].DefaultView;
作者:jiankunking 出處:https://blog.csdn.net/jiankunking
最後更新:2017-04-03 12:54:06