views:

13

answers:

1

Hi,

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 Visual 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

+2  A: 

Use a SQLCommand, which has an ExecuteNonQuery method:

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

LesterDove
Thank you for the help.
fema