方法1: Insert into
方法2: 与DataSet绑定然后操纵DataSet,最后Update
方法2: 与DataSet绑定然后操纵DataSet,最后Update
解决方案 »
- 修改了代码,现在...
- 大家帮我看看这样写,为什么不对
- System.Net.Mail发邮件为什么会不成功
- .net1.1 c# 按钮提交之前 想用前台脚本验证,通过了再执行后台的ServerClick事件 怎么写
- 如何在richtextbox中插入表格
- 关于连接sql2000出错 在线
- 请教关于委托与事件的一个具体应用
- girl#c#girl?
- 怎么在EXCEL中得到有下拉框的内容啊???急在线等的~~~~~~~~~
- 请问学C#需要具备那些基础知识?C#程序的与C++及DEPHI比运行效率怎样?
- 如何将修改后的DataGrid所有数据导入Crystal Report预览和打印
- 关于remoting中通道注册的问题??
...
..Sqlconnection conn = new SqlConnection("...connecting string...");
string sqlIns = "Insert into .......";//Sql Statement
SqlCommand cmd = new SqlCommand(sqlIns,conn);
Sqlcommand.ExecuteNonQuery();
.....
catDA.InsertCommand.CommandType = CommandType.Text; catDA.InsertCommand.Parameters.Add("@CategoryName", OleDbType.Char, 15, "CategoryName"); nwindConn.Open();
// Fill the DataSet.
DataSet catDS = new DataSet();
catDA.Fill(catDS, "Categories"); // Add a new row.
DataRow newRow = catDS.Tables["Categories"].NewRow();
newRow["CategoryName"] = "New Category";
catDS.Tables["Categories"].Rows.Add(newRow); // Include an event to fill in the Autonumber value.
// Update the DataSet.
catDA.Update(catDS, "Categories"); nwindConn.Close();
不知对你是否有用?