Server Error Understanding

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Server Error Understanding

    Please help me understand this Error???

    Server Error in '/solo' Application.
    ----------------------------------------------------------------------------
    ----

    Object must implement IConvertible.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.InvalidCastException: Object must implement
    IConvertible.

    Source Error:

    Line 509: Me.cmdAddMember.Parameters(30).Value =
    Me.txtCurrentDate.Text
    Line 510: Me.cmdAddMember.Connection.Open()
    Line 511: Me.cmdAddMember.ExecuteNonQuery()
    Line 512: Me.cmdAddMember.Connection.Close()
    Line 513: Me.txtMemberId.Visible = True

    Source File: c:\inetpub\wwwroot\solo\reg\index.aspx.vb Line: 511

    Stack Trace:

    [InvalidCastException: Object must implement IConvertible.]
    System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
    System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196
    solo.index.btSubmit_Click(Object sender, EventArgs e) in
    c:\inetpub\wwwroot\solo\reg\index.aspx.vb:511
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
    stBackEvent(String eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1277



    ----------------------------------------------------------------------------
    ----



    Leon Shaw Guest

  2. Similar Questions and Discussions

    1. Needs help understanding the product
      Is Flash Media Server 2 an actual server that you buy and install on your computer to host your flash files? I'm really confused in that the server...
    2. A little understanding
      I am fairly new to all of this so please bare with me... 1. With this flash streaming server, does anyone know if it is possible to upload any type...
    3. understanding error message
      Someone please help me understand the following error message: Server Error in '/solo' Application....
    4. Help understanding MAP
      After reading llama, camel, perldoc and searching web for explainations, I just don't get how map works. I'm sure it is something simple. I'm...
    5. error while installing on-board NIC on Proliant 1600 server in SCO Open Server 5.0.5
      dear all, While installing the EFS, when I configure the TCP/IP then i get the messages while relinking the kernel. i encountered the message...
  3. #2

    Default Re: Server Error Understanding

    What is the data type for parameter 30? datetime? In that case, try:

    cmdAddMember.Parameters(30).Value = DateTime.Parse(txtCurrentDate.Text)


    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]

    BTW, notice that you don't have to say "Me.".

    "Leon Shaw" <vnality@msn.com> wrote in message
    news:edF2RAKVDHA.2316@TK2MSFTNGP09.phx.gbl...
    > Please help me understand this Error???
    >
    > Server Error in '/solo' Application.
    > --------------------------------------------------------------------------
    --
    > ----
    >
    > Object must implement IConvertible.
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.InvalidCastException: Object must implement
    > IConvertible.
    >
    > Source Error:
    >
    > Line 509: Me.cmdAddMember.Parameters(30).Value =
    > Me.txtCurrentDate.Text
    > Line 510: Me.cmdAddMember.Connection.Open()
    > Line 511: Me.cmdAddMember.ExecuteNonQuery()
    > Line 512: Me.cmdAddMember.Connection.Close()
    > Line 513: Me.txtMemberId.Visible = True
    >
    > Source File: c:\inetpub\wwwroot\solo\reg\index.aspx.vb Line: 511
    >
    > Stack Trace:
    >
    > [InvalidCastException: Object must implement IConvertible.]
    > System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
    > cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
    > System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196
    > solo.index.btSubmit_Click(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\solo\reg\index.aspx.vb:511
    > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    >
    >
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
    > stBackEvent(String eventArgument) +57
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    > sourceControl, String eventArgument) +18
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    > System.Web.UI.Page.ProcessRequestMain() +1277
    >
    >
    >
    > --------------------------------------------------------------------------
    --
    > ----
    >
    >
    >

    John Saunders Guest

  4. #3

    Default Re: Server Error Understanding

    Yes. The problem is that you're supplying strings to your smalldatetime
    parameters. You need to use cmdAddMember.Parameter(n).Value =
    DateTime.Parse(whatever.Text).

    Once you get that working, I'd also recommend that you stop using numeric
    indexes for the parameters. What happens to your code if the order of the
    parameters changes? Try cmdAddMember.Parameter("@RenewalDate").Value
    instead.

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]

    P.S. Don't you get tired of typing "Me." all the time?


    "Leon Shaw" <vnality@msn.com> wrote in message
    news:%23NI73YKVDHA.1676@TK2MSFTNGP10.phx.gbl...
    > (Do You See A Problem!) This is the Store Proceduce I'm using.
    >
    > REATE PROCEDURE [Add_Member]
    > (@Username [varchar](20),
    > @Password [varchar](16),
    > @SecretQuestion [varchar](50),
    > @SecretAnswer [varchar](64),
    > @FirstName [varchar](64),
    > @LastName [varchar](64),
    > @BirthMonth [varchar](10),
    > @BirthDay [tinyint],
    > @BirthYear [smallint],
    > @Gender [varchar](6),
    > @SchoolState [varchar](50),
    > @SchoolName [varchar](200),
    > @Classification [varchar](50),
    > @Major [varchar](120),
    > @CreditCardName [varchar](120),
    > @CreditCardType [varchar](20),
    > @CreditCardNumber [varchar](16),
    > @CreditCardExpMonth [varchar](10),
    > @CreditCardExpYear [smallint],
    > @BillingAddress1 [varchar](200),
    > @BillingAddress2 [varchar](200),
    > @BillingCity [varchar](200),
    > @BillingState [varchar](50),
    > @BillingPostalCode [varchar](10),
    > @EmailAddress [varchar](64),
    > @PhoneAreaCode [char](3),
    > @PhoneNumber [varchar](8),
    > @ActivationDate [smalldatetime],
    > @RenewalDate [smalldatetime],
    > @LastUpdate [smalldatetime])
    >
    > AS INSERT INTO [Stunation].[dbo].[TAB_Member]
    > ( [Username],
    > [Password],
    > [SecretQuestion],
    > [SecretAnswer],
    > [FirstName],
    > [LastName],
    > [BirthMonth],
    > [BirthDay],
    > [BirthYear],
    > [Gender],
    > [SchoolState],
    > [SchoolName],
    > [Classification],
    > [Major],
    > [CreditCardName],
    > [CreditCardType],
    > [CreditCardNumber],
    > [CreditCardExpMonth],
    > [CreditCardExpYear],
    > [BillingAddress1],
    > [BillingAddress2],
    > [BillingCity],
    > [BillingState],
    > [BillingPostalCode],
    > [EmailAddress],
    > [PhoneAreaCode],
    > [PhoneNumber],
    > [ActivationDate],
    > [RenewalDate],
    > [LastUpdate])
    >
    > VALUES
    > ( @Username,
    > @Password,
    > @SecretQuestion,
    > @SecretAnswer,
    > @FirstName,
    > @LastName,
    > @BirthMonth,
    > @BirthDay,
    > @BirthYear,
    > @Gender,
    > @SchoolState,
    > @SchoolName,
    > @Classification,
    > @Major,
    > @CreditCardName,
    > @CreditCardType,
    > @CreditCardNumber,
    > @CreditCardExpMonth,
    > @CreditCardExpYear,
    > @BillingAddress1,
    > @BillingAddress2,
    > @BillingCity,
    > @BillingState,
    > @BillingPostalCode,
    > @EmailAddress,
    > @PhoneAreaCode,
    > @PhoneNumber,
    > @ActivationDate,
    > @RenewalDate,
    > @LastUpdate)
    >
    > SELECT MemberID = @@IDENTITY
    > GO
    > This is the code inside of vs.net
    > If Me.IsValid = True Then
    >
    > Me.txtMemberId.Text = Me.cmdAddMember.Parameters(0).Value
    >
    > Me.cmdAddMember.Parameters(1).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
    >
    > Me.cmdAddMember.Parameters(10).Value = Me.rbtGender.SelectedItem
    >
    > Me.cmdAddMember.Parameters(11).Value = Me.ddlSchoolState.SelectedItem
    >
    > Me.cmdAddMember.Parameters(12).Value = Me.ddlSchoolName.SelectedItem
    >
    > Me.cmdAddMember.Parameters(13).Value = Me.ddlClassification.SelectedItem
    >
    > Me.cmdAddMember.Parameters(14).Value = Me.ddlSchoolMajor.SelectedItem
    >
    > Me.cmdAddMember.Parameters(15).Value = Me.txtCreditCardName.Text
    >
    > Me.cmdAddMember.Parameters(16).Value = Me.ddlCreditCardType.SelectedItem
    >
    > Me.cmdAddMember.Parameters(17).Value = Me.txtCreditCardNumber.Text
    >
    > Me.cmdAddMember.Parameters(18).Value = Me.ddlExpMonth.SelectedItem
    >
    > Me.cmdAddMember.Parameters(19).Value = Me.ddlExpYear.SelectedItem
    >
    > Me.cmdAddMember.Parameters(20).Value = Me.txtBillingAddress1.Text
    >
    > Me.cmdAddMember.Parameters(21).Value = Me.txtBillingAddress2.Text
    >
    > Me.cmdAddMember.Parameters(22).Value = Me.txtBillingCity.Text
    >
    > Me.cmdAddMember.Parameters(23).Value = Me.ddlBillingState.SelectedItem
    >
    > Me.cmdAddMember.Parameters(24).Value = Me.txtBillingZipCode.Text
    >
    > Me.cmdAddMember.Parameters(25).Value = Me.txtEmail.Text
    >
    > Me.cmdAddMember.Parameters(26).Value = Me.txtPhonerAreaCode.Text
    >
    > Me.cmdAddMember.Parameters(27).Value = Me.txtPhone.Text
    >
    > Me.cmdAddMember.Parameters(28).Value = Me.txtCurrentDate.Text
    >
    > Me.cmdAddMember.Parameters(29).Value = (Me.txtFutureDate.Text)
    >
    > Me.cmdAddMember.Parameters(30).Value = (Me.txtCurrentDate.Text)
    >
    > Me.cmdAddMember.Connection.Open()
    >
    > Me.cmdAddMember.ExecuteNonQuery()
    >
    > Me.cmdAddMember.Connection.Close()
    >
    > Me.txtMemberId.Visible = True
    >
    > End If
    >
    > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > news:O1ST9HKVDHA.2164@TK2MSFTNGP09.phx.gbl...
    > > What is the data type for parameter 30? datetime? In that case, try:
    > >
    > > cmdAddMember.Parameters(30).Value = DateTime.Parse(txtCurrentDate.Text)
    > >
    > >
    > > --
    > > John Saunders
    > > Internet Engineer
    > > john.saunders@surfcontrol.com
    > >
    > > BTW, notice that you don't have to say "Me.".
    > >
    > > "Leon Shaw" <vnality@msn.com> wrote in message
    > > news:edF2RAKVDHA.2316@TK2MSFTNGP09.phx.gbl...
    > > > Please help me understand this Error???
    > > >
    > > > Server Error in '/solo' Application.
    > >
    >
    > --------------------------------------------------------------------------
    > > --
    > > > ----
    > > >
    > > > Object must implement IConvertible.
    > > > Description: An unhandled exception occurred during the execution of
    the
    > > > current web request. Please review the stack trace for more
    information
    > > > about the error and where it originated in the code.
    > > >
    > > > Exception Details: System.InvalidCastException: Object must implement
    > > > IConvertible.
    > > >
    > > > Source Error:
    > > >
    > > > Line 509: Me.cmdAddMember.Parameters(30).Value =
    > > > Me.txtCurrentDate.Text
    > > > Line 510: Me.cmdAddMember.Connection.Open()
    > > > Line 511: Me.cmdAddMember.ExecuteNonQuery()
    > > > Line 512: Me.cmdAddMember.Connection.Close()
    > > > Line 513: Me.txtMemberId.Visible = True
    > > >
    > > > Source File: c:\inetpub\wwwroot\solo\reg\index.aspx.vb Line: 511
    > > >
    > > > Stack Trace:
    > > >
    > > > [InvalidCastException: Object must implement IConvertible.]
    > > > System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
    > > > cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
    > > > System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196
    > > > solo.index.btSubmit_Click(Object sender, EventArgs e) in
    > > > c:\inetpub\wwwroot\solo\reg\index.aspx.vb:511
    > > > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    > > >
    > > >
    > >
    >
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
    > > > stBackEvent(String eventArgument) +57
    > > > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    > > > sourceControl, String eventArgument) +18
    > > > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
    > +33
    > > > System.Web.UI.Page.ProcessRequestMain() +1277
    > > >
    > > >
    > > >
    > >
    >
    > --------------------------------------------------------------------------
    > > --
    > > > ----
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    John Saunders Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139