Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in .NET only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
.NET
how to use stored procedure in a asp.net
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
sridhar21
New Member
Join Date:
Feb 2007
Posts:
26
#1
how to use stored procedure in a asp.net
Feb 22 '07, 01:45 PM
Hai to all
i am sridhar
i have one doubt
how to use stored procedure in a asp.net
wait for your reply
shweta123
Recognized Expert
Contributor
Join Date:
Nov 2006
Posts:
692
#2
Feb 22 '07, 03:24 PM
Hi,
This is the example of how you can call the procedure-
Lets say procedure is Proc1(p1 nvarchar(50),p2 int out)
Dim con as New OleDb.OleDbConn ection
Dim com As New OleDb.OleDbComm and
con.ConnectionS tring="SQLOLEDB .1;Persist Security Info=True;User ..........."
con.open
'Declare the parameters
Dim pin As New OleDb.OleDbPara meter 'Input Parameter
Dim pout As New OleDb.OleDbPara meter 'Output Parameter
pin.Direction = ParameterDirect ion.Input
pin.ParameterNa me = "p1"
pin.Size = 50
pin.DbType = DbType.String
pout.Direction = ParameterDirect ion.Output
pout.ParameterN ame = "p2"
pout.DbType = DbType.Int32
com.Parameters. Add(pin)
com.Parameters. Add(pout)
com.CommandType = CommandType.Sto redProcedure
'Here give the procedure Name
com.CommandText = "Proc1"
com.ExecuteNonQ uery()
'Get the value from pout as pout.Value
Shweta
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment