使用存储过程进行更新和删除的前端和后端代码 [英] front end and back end code of update and delete by using stored procedure
本文介绍了使用存储过程进行更新和删除的前端和后端代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请使用存储过程提供更新和删除的前端和后端代码
please give the front end and back code of update and delete by using stored procedure
推荐答案
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand com = new SqlCommand("proc_update", con))
{
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@uid", "My new uid");
com.Parameters.AddWithValue("@uname", "My new uname");
com.Parameters.AddWithValue("@uip", "My new uip");
com.ExecuteNonQuery();
}
删除几乎相同...
Delete would be much the same...
这是创建
的方法 ^ ]
在这里您可以得到一个例子:
点击此处 [通过存储过程插入和检索数据 [ ^ ]
将此参考通过存储过程插入单个值 [ ^ ]
This is how you can create
Stored Procedures[^]
Here you can get an example:
Click Here[^]
A good article on CP
Insert and retrieve data through stored procedure[^]
Refer this to Insert Single Value With Stored Procedure[^]
这篇关于使用存储过程进行更新和删除的前端和后端代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文