CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Feb 2003
    Posts
    16

    Email Address Text String Problem

    Hi,

    I am having a problem storing an Email Address in an SQL database using .net (ASP). I think the problem is in .net.

    I run a storred procedure by passing parameters.
    Some code:

    SqlCommand1.Parameters("@Email").Value = Str(htxtEmail.Value)
    SqlCommand1.Parameters("@UserID").Value = CStr(txtUserID.Value)
    SqlCommand1.Parameters("@Password").Value = Password1.Value
    SqlCommand1.Parameters("@FName").Value = FName.Value
    SqlCommand1.Parameters("@LName").Value = LName.Value
    SqlCommand1.Parameters("@Zip").Value = Zip.Value SqlCommand1.Parameters("@CountryCode").Value = RTrim(ddlCountry.SelectedItem.Value)

    SqlCommand1.ExecuteScalar()

    If I enter an Email Address such as [email protected] I get this error: "Input string was not in a correct format." I think .net is interpetting a small Email address as a number somehow.

    I have tried many dtring conversions and changes to Parameter collections but no help.

    The Stack Trace is attached in case somebody knows how to interpet it.

    Anybody have any ideas????
    Attached Files Attached Files

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

Featured