开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜