Accessing SQL Server Stored Procedure from VB.NET

G

Guest

Hi,

I have a SQL Stored Procedure :

CREATE PROCEDURE spFilterOne
@city varchar(25)
AS
SELECT * FROM tblCities
WHERE tblCities.strCity = @city
ORDER BY tblCities.strName


In VB.NET, I would like to create a hashtable and add a key, which will be
sent to the stored procedure, as parameter @city

Dim hsParams As Hashtable
hsParams.Add("@param1", "London")


My Question :

How can I execute this stored procedure, with the hashtable giving the
parameter, from VB.NET? Once execute, I can put the rows into a dataset, that
works fine.. but its just executing the stored procedure. Thanks!!
 
W

W.G. Ryan eMVP

crisp - you can just create a command object and populate its Paramaters
collection - it gets you to the same place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top