stored procedure select statement with where clause

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Can anybody give me a sample code / sql script showing correc syntax
like SELECT * FROM TABLE WHERE FIELD =

the value to the where clause , i should be able to pass from the front end

it should return a result

how do i take this result? in a datareader? or in dataset?

thanks,
ss
 
ss,

This depends if it is OleDB or SQLClient or whatever.

SQLClient uses named parameters, OleDB does not here is the sequentce in
what the parmameters are given important.

See here a sample on our website

http://www.vb-tips.com/default.aspx?ID=550279ec-6767-44ff-aaa3-eb8b44af0137

If you want to bring the text Selelect to a stored procedure select than you
have to set in front the declaration of the used parameters.

ALTER Procedure [dbo].[sp_UseDateSample] @OrderDate TimeDate AS

I hope this helps,

Cor
 
I meant, get a book on ASP.NET. Any book will describe what you are looking
for

amazon.com

Jeff
 
Back
Top