Results 1 to 10 of 10

Thread: passing paramiters to sp's

Hybrid View

  1. #1
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Looks fine to me or atleast nothing 'seems' out of place. I'd save myself some typing when creating the command but that is strictly personal.
    VB Code:
    1. Dim cmd As New SqlCommand("insRecord", _
    2. New SqlConnection("Password=KJH987KJ;Persist Security Info=True;User ID=sa;Initial Catalog=MortgageFlowDev;Data Source=COSERV01\MORTGAGEFLOWLIVE"))
    3. cmd.CommandType = CommandType.StoredProcedure
    4. cmd.Parameters.Add(New SqlParameter("@strTitle", "Mr"))
    5. cmd.Parameters.Add(New SqlParameter("@strFirstName", "wolly"))
    6. cmd.Parameters.Add(New SqlParameter("@strSurname", "woo"))

    Are you using SQL7 and I think that articles is relative to the Prepare method. Actually if you want to make life easier then you should check out the MS Data Access Blocks.

    http://msdn.microsoft.com/library/de...ml/daab-rm.asp

    It is basically a set of wrapper type classes that simplify the process.
    Last edited by Edneeis; Sep 25th, 2003 at 11:14 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width