|
-
Oct 29th, 2002, 04:15 PM
#1
Thread Starter
Lively Member
Passing parameters to a stored proc
OK, this may be a silly question, but I'm all about saving time and space in my code.
Right now this is what my code looks like to insert a record thru a sp:
cn.Open()
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "sp_Request"
With cmd
.Parameters.Add("@Request", SqlDbType.VarChar, 200)
.Parameters("@Request").Direction = ParameterDirection.Input
.Parameters("@Request").Value = getTypes()
.Parameters.Add("@Rq_No", SqlDbType.VarChar, 200)
.Parameters("@Rq_no").Direction = ParameterDirection.Input
.Parameters("@Rq_no").Value = getPermitNumber()
End With
Is there a more compact way of doing this?
I'm still feeling my way thru .net.
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
|