I am new to Visual Basic and am having some difficulty calling a stored procedure in a SQL Server database.
I have set up a Stored Procedure in SQL server, uspGetCompanyDetails, which has a parameter of @CompanyID.
When calling the stored procedure in Visual Basic, I have used the following line of code;
Dim objDataAdapter As New SqlDataAdapter("uspGetCompanyDetails 6", objConnection)
This code fires on a button click event and works fine, however I wish to remove the refernce "6" parameter from the code, and have the parameter @CompanyID enetered into a text box on the VB form, in this case TextBox1, prior to the click event and then passed into the code as a parameter. I have been trying to follow some book examples, however I am getting no where fast.
Any suggestions would be very much appreciated.

Calling SQL Server Stored Procedures in VB 2005
Chango V.
Mike Harsh
Try the following example:
HOW TO: Call Stored Procedures with Optional Values in ADO.NET
Rodrigo Wolburg
This does not seem to work for me. I am having trouble with my CommandText. I am not sure if I should have the CommandText in quotes "" or not.
If I do not use quotes it tells me that it is not declared and if I use quotes it sees it as a string and not as the procedure name.
Any thoughts