|
-
January 24th, 2006, 11:26 AM
#1
How to call Stored Procedure in ASP.NET
Hi everyone,
I've a Stored Procedure in Oracle which has one input parameter and one output parameter.
How to call this Stored procedure in ASP.NET?
Below is my coding. I get error.
Dim conn As New OleDbConnection(str)
conn.Open()
Dim cmd As New OleDbCommand("GetSalary", conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New OleDbParameter("empid", OleDbType.Integer))
cmd.Parameters("empid").Value = TextBox1.Text
cmd.Parameters.Add(New OleDbParameter("salary", OleDbType.Integer, 6))
cmd.Parameters("salary").Direction = ParameterDirection.Output
Dim sal As String
sal = cmd.Parameters("salary").Value
cmd.ExecuteReader()
conn.Close()
Am i wrong? Then how to execute it? Can anyone guide me.
-
haifriends
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|