VB.NET - how to write stored procedure of this query

Asked By prasad vjp
10-Feb-12 02:12 AM

how to write stored procedure of this query

"

Select ID, DestinationNo From Tbl_UserBlackList whereUser_ID={0}{1}

  Web Star replied to prasad vjp
10-Feb-12 02:16 AM
simply try this way

Create proc spname
(
@userid int
)
AS
Begin
Select ID, DestinationNo From Tbl_UserBlackList whereUser_ID=@userid 


End
  Reena Jain replied to prasad vjp
10-Feb-12 05:51 AM
Hi,

Use In clause if you want to check more then one option in where condition like this
Create proc spname
(
@userid int
)
AS
Begin

Select ID, DestinationNo From Tbl_UserBlackList where User_ID in (0,1)
or
Select ID, DestinationNo From Tbl_UserBlackList where User_ID in (@userid)

try this and let me know
Create New Account
help
Stored Procedure VB.NET Can you give one example for Stored procedure in Front-End & Back-End Respectively? To Create Procedure Go to solution explorer expand database and from the stored Procedure , right click on it and choose new stored procedure ALTER PROCEDURE dbo.Insertion ( @f1
Create Stored Procedure and modify table property in VB.Net & SQL .NET Framework 1. How do i create a stored procedure in VB.Net and then execute it in VB.Net? 2. How do I modify a table property
Stored Procedure VB.NET Can you give step by step procedure to creation of stored procedure in front end back end respectively? To Create Procedure Go to solution explorer expand database and from the stored Procedure , right click on it
Dynamic Crystal Report in VB.Net 2005 .NET Framework I have created a Crystal Report with Stored Procedure using vb.net 2005. How do I change or pass Stored Procedure name from VB.Net to Crystal Report instead of hard coding in to vb.net
stored procedure What is mean by stored procedure? for all detail with examples Stored Procedure A stored procedure is a set of one or more SQL statements that are stored together in database