开发者

How to make VB to execute my SQL SP with parameters?

开发者 https://www.devze.com 2023-01-01 05:25 出处:网络
I have a database in MS SQL Server 2008, I have Stored Procedures. One of them does an INSERT with parameters. It works in Server Management Studio.

I have a database in MS SQL Server 2008, I have Stored Procedures. One of them does an INSERT with parameters. It works in Server Management Studio.

Now I'd like to make a button in Visua开发者_如何转开发l Basic 2008 that executes this SP. I have made a DataSet, it contains my 3 SP's, I can easily use 2 of them, because they return data, but the one I'm having trouble with doesn't. Could anyone please tell me how to make VB to execute it? (The command should look like this: "EXECUTE SP2 a, b, c, d".)

Thanks in advance


Use a SQLCommand, which has an ExecuteNonQuery method:

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executenonquery.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消