Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Stored Procedure Problem (http://www.velocityreviews.com/forums/t60871-stored-procedure-problem.html)

Leon Shaw 07-28-2003 08:19 PM

Stored Procedure Problem
 
I'm I Assign the value to the following store procedures correctly in
vs.net?
(The code is my only concern)
Me.cmdAddMember.Parameters("@Username").Value = Me.txtUsername.Text

Me.cmdAddMember.Parameters(2).Value = Me.txtPassword.Text

Me.cmdAddMember.Parameters(3).Value = Me.ddlSecretQuestion.SelectedItem

Me.cmdAddMember.Parameters(4).Value = Me.txtSecretAnswer.Text

Me.cmdAddMember.Parameters(5).Value = Me.txtFirstName.Text

Me.cmdAddMember.Parameters(6).Value = Me.txtLastName.Text

Me.cmdAddMember.Parameters(7).Value = Me.ddlBirthMonth.SelectedItem

Me.cmdAddMember.Parameters(8).Value = Me.ddlBirthDay.SelectedItem

Me.cmdAddMember.Parameters(9).Value = Me.txtBirthYear.Text

etc.



Jurjen de Groot 07-29-2003 09:19 AM

Re: Stored Procedure Problem
 
Leon,

You should always name the parameter, you only named the first (@Username)
the others you just assigned values. Why not try this, it's more readable
too !!

With Me.cmdAddMember
.Parameters.Add("@Username", Me.txtUsername.text)
.Parameters.Add("@Password", Me.txtPassword.text)
etc...
End With

Hope this helps.

Jurjen de Groot
G.I.T.S., Netherlands

"Leon Shaw" <vnality@msn.com> wrote in message
news:%23HANJWUVDHA.1316@TK2MSFTNGP12.phx.gbl...
> I'm I Assign the value to the following store procedures correctly in
> vs.net?
> (The code is my only concern)
> Me.cmdAddMember.Parameters("@Username").Value = Me.txtUsername.Text
>
> Me.cmdAddMember.Parameters(2).Value = Me.txtPassword.Text
>
> Me.cmdAddMember.Parameters(3).Value = Me.ddlSecretQuestion.SelectedItem
>
> Me.cmdAddMember.Parameters(4).Value = Me.txtSecretAnswer.Text
>
> Me.cmdAddMember.Parameters(5).Value = Me.txtFirstName.Text
>
> Me.cmdAddMember.Parameters(6).Value = Me.txtLastName.Text
>
> Me.cmdAddMember.Parameters(7).Value = Me.ddlBirthMonth.SelectedItem
>
> Me.cmdAddMember.Parameters(8).Value = Me.ddlBirthDay.SelectedItem
>
> Me.cmdAddMember.Parameters(9).Value = Me.txtBirthYear.Text
>
> etc.
>
>





All times are GMT. The time now is 11:09 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.