Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Stored Procedure Problem

Reply
Thread Tools

Stored Procedure Problem

 
 
Leon Shaw
Guest
Posts: n/a
 
      07-28-2003
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(.Value = Me.ddlBirthDay.SelectedItem

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

etc.


 
Reply With Quote
 
 
 
 
Jurjen de Groot
Guest
Posts: n/a
 
      07-29-2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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(.Value = Me.ddlBirthDay.SelectedItem
>
> Me.cmdAddMember.Parameters(9).Value = Me.txtBirthYear.Text
>
> etc.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with stored procedure =?Utf-8?B?SnVzdGlu?= ASP .Net 4 12-12-2008 06:47 PM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Stored Procedure problem The Clansman ASP .Net 1 05-18-2004 11:32 PM
Interesting Stored Procedure Problem.. Bilbo ASP .Net 3 11-20-2003 09:31 PM
Stored Procedure/Parameter problem ElmoWatson ASP .Net 1 08-06-2003 01:19 AM



Advertisments