Ask a Question related to ASP.NET General, Design and Development.
-
Leon Shaw #1
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
-
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... -
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... -
understanding error message
Someone please help me understand the following error message: Server Error in '/solo' Application.... -
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... -
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... -
John Saunders #2
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.
> --------------------------------------------------------------------------System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo> ----
>
> 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
>
>--> 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
-
John Saunders #3
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...the> (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 ofinformation> > > current web request. Please review the stack trace for moreSystem.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo>> >> > > 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
> > >
> > >> +33> > > stBackEvent(String eventArgument) +57
> > > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
> > > sourceControl, String eventArgument) +18
> > > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)>> >> > > System.Web.UI.Page.ProcessRequestMain() +1277
> > >
> > >
> > >
> -------------------------------------------------------------------------->> > --> >> > > ----
> > >
> > >
> > >
> >
>
John Saunders Guest



Reply With Quote

