关于网友提出的“调用存储过程 怎么调用存储过程”问题疑问,本网通过在网上对“调用存储过程 怎么调用存储过程”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题:调用存储过程 怎么调用存储过程
描述: 我写了一个存储过程:
Create Procedure Pro_PostSubject
@PostName nvarchar(100),
@PostSubject nvarchar(200),
@PostMessage text,
@PostTime nvarchar(30),
@PostIP nvarchar(20)
AS
begin tran
insert into post(postname,subject,message,posttime,ip) values(@Postname,@PostSubject,@PostMessage,@PostTime,@PostIP)
commit tran
go
现在我要调用它 代码应该怎么写呢(用C#)
在类里面怎么写呢?
public static string InsertInto(string postname,string subject,string message,string posttime,string ip)
{
SqlConnection c />
SqlCommand cmd= new SqlCommand();
这里再怎么写呢?
}
以上介绍了“调用存储过程 怎么调用存储过程”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3278697.html