By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

calling stored procedures with parameters

P: n/a
I have a form with 5 strings serving as search parameters.
I collect them from the form, store them in local variables and call a
stored procedure executing a select based on these parameters
When the parameters are left empty in the form, I nees to make a select
without conditions on that parameter.
How to call the stored procedure in VB.net, when the variables contain null
values?

Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
http://www.knowdotnet.com/articles/d...arameters.html
"news.verizon.net" <no****@nospam.no> wrote in message
news:J5*****************@nwrdny02.gnilink.net...
I have a form with 5 strings serving as search parameters.
I collect them from the form, store them in local variables and call a
stored procedure executing a select based on these parameters
When the parameters are left empty in the form, I nees to make a select
without conditions on that parameter.
How to call the stored procedure in VB.net, when the variables contain null values?

Jul 21 '05 #2

P: n/a
Very good article indeed, but my problem is like
cmd.Parameters.Add("@p_FirstValue", myvar);

where mycar can be assigned plenty of values including NULL.
the null how is it passed?

"William Ryan" <do********@nospam.comcast.net> wrote in message
news:eX**************@TK2MSFTNGP10.phx.gbl...
http://www.knowdotnet.com/articles/d...arameters.html
"news.verizon.net" <no****@nospam.no> wrote in message
news:J5*****************@nwrdny02.gnilink.net...
I have a form with 5 strings serving as search parameters.
I collect them from the form, store them in local variables and call a
stored procedure executing a select based on these parameters
When the parameters are left empty in the form, I nees to make a select
without conditions on that parameter.
How to call the stored procedure in VB.net, when the variables contain

null
values?


Jul 21 '05 #3

P: n/a
Don't give it a value ("@p_FirstValue") or ("@p_FirstValue", DbNull.Value)
"news.verizon.net" <no****@nospam.no> wrote in message
news:%1*****************@nwrdny03.gnilink.net...
Very good article indeed, but my problem is like
cmd.Parameters.Add("@p_FirstValue", myvar);

where mycar can be assigned plenty of values including NULL.
the null how is it passed?

"William Ryan" <do********@nospam.comcast.net> wrote in message
news:eX**************@TK2MSFTNGP10.phx.gbl...
http://www.knowdotnet.com/articles/d...arameters.html
"news.verizon.net" <no****@nospam.no> wrote in message
news:J5*****************@nwrdny02.gnilink.net...
I have a form with 5 strings serving as search parameters.
I collect them from the form, store them in local variables and call a
stored procedure executing a select based on these parameters
When the parameters are left empty in the form, I nees to make a select without conditions on that parameter.
How to call the stored procedure in VB.net, when the variables contain

null
values?



Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.