牛人来解释一下代码,要通俗易懂哈,每一行都解释一下,包括用到什么知识等,我菜鸟看不懂啊,希望牛人 150
牛人来解释一下代码,要通俗易懂哈,没一行都解释一下,包括用到什么知识等,我菜鸟看不懂啊,希望牛人指导一下啊,代码:sqlconnectionconn=newsqlconn...
牛人来解释一下代码,要通俗易懂哈,没一行都解释一下,包括用到什么知识等,我菜鸟看不懂啊,希望牛人指导一下啊,代码:sqlconnection conn = new sqlconnection(connstring);
sqlDataAdapter adpter = new sqlDataAdapter();
for (int i=0; i<hrSet.Tables["Employees"].Row.count; i++)
{
if (Convert.ToInt32(hrSet..Tables["Employees"].Rows[ i ][ 0 ]) == id)
{ hrSet.Tables["Employees"].Rows[ i ][ 1 ] = newName ;
break;
}
}
//.....省略构造的参数化SQL语句
sqlcommand cmd = new sqlcommand (sql.Tostring(), conn);
cmd.parameters.add("@employeeid", sqldbtype.int, 4 , "Employeeid");
cmd.parameters.add("@employeename", sqldbtype.NVarChar, 10 , "EmployeeName");
cmd.parameters["@employeename"].SourceVersion = DataRowVersion.current;
adapter.updatecommand = cmd ;
adapter.update (hrSet, "Employees");
谢谢你看完了,多谢多谢啊
没会的吗????我分多啊 展开
sqlDataAdapter adpter = new sqlDataAdapter();
for (int i=0; i<hrSet.Tables["Employees"].Row.count; i++)
{
if (Convert.ToInt32(hrSet..Tables["Employees"].Rows[ i ][ 0 ]) == id)
{ hrSet.Tables["Employees"].Rows[ i ][ 1 ] = newName ;
break;
}
}
//.....省略构造的参数化SQL语句
sqlcommand cmd = new sqlcommand (sql.Tostring(), conn);
cmd.parameters.add("@employeeid", sqldbtype.int, 4 , "Employeeid");
cmd.parameters.add("@employeename", sqldbtype.NVarChar, 10 , "EmployeeName");
cmd.parameters["@employeename"].SourceVersion = DataRowVersion.current;
adapter.updatecommand = cmd ;
adapter.update (hrSet, "Employees");
谢谢你看完了,多谢多谢啊
没会的吗????我分多啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询