473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Accessing SQL Server Stored Procedure from VB.NET

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!!
Jul 21 '05 #1
1 1713
crisp - you can just create a command object and populate its Paramaters
collection - it gets you to the same place.

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"crisp99" <cr*****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
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!!

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mingzhen | last post by:
Hi, I have a problem here when I code stored procedure to manipulate data in database. My idea is that if I can save all data I get in some arrays I should be able to manipulate the arrays...
3
by: Michael | last post by:
This one's really got me. I have a VB.NET (version 1.1.4322) project that provides an easy way to execute stored procedures on a generic level. When I run the code on computer A (running SQL...
1
by: David C. Allen | last post by:
I am trying to debug an SQL Server Stored Procedure form VS.NET 2003. I have a break point set in the SP code but it is not being hit. When I hold the pointer over the line it says that it will not...
3
by: Niyazi | last post by:
Hi, Me again. I want to create a SQL Server StoreProcedure and I want to access it with ADO.NET. I am using VB.NET. Creating StoreProcedure it was easy but my question is this. I have table...
6
by: fumanchu | last post by:
I've got to let end users (really just one person) load billing batch files into a third party app table. They need to specify the billing cycle name, the batch name, and the input file name and...
2
by: honcho | last post by:
Hello, Does anyone have an example of an SQL Server stored procedure that updates a record, where one of its field is of type "text"? My procedure is /* ** Update the client note and...
1
by: crisp99 | last post by:
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
4
by: Mr Not So Know It All | last post by:
im new to SQL Server and ASP.Net. Here's my problem. I have this SQL Server stored procedure with an input parameter and output parameter CREATE PROCEDURE . @in_rc varchar(8) @out_eList...
1
by: seyyadri | last post by:
Hi, I want the data in excel, pulled from SQL server stored procedure. The SQL SP has the parameters. when we open/refresh the excel it should prompt the user to enter the parameters (dynamically),...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.