Results 1 to 8 of 8

Thread: ADO update error

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40

    ADO update error

    I am getting a strange error when trying to update a field in my data table. Was happeining intermittingly, but now for every record:


    Line 211: DataSetAttendance1.Attendance.Rows(0)("Description") = Trim(txt_description.Text)
    Line 212: SqlDataAdapter2.Update(DataSetAttendance1)

    Error:

    Input string was not in a correct format.
    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.FormatException: Input string was not in a correct format.


    Any clues?

    Thanks


  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Is the data type in the dataset a/o db a string value?

  3. #3
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    try
    VB Code:
    1. DataSetAttendance1.Attendance.Rows(0)("Description") = Trim(txt_description.Text).ToString()
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40
    Tried that, no dice. Maybe a CType command?

    This is so strange because it was working just fine, and has been no changes to that field in the table.

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40

    Got a clue

    Okay the problem is a field that was changed from numeric to string. I deleted the dataset and created a new dataset from the adapter. The schema of the new dataset is good, but when I try to preview the data in the adapter I get an error saying the field is in bad format (still numeric) Do I have to create a new adaptor?

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40

    Got a clue

    Okay the problem is a field that was changed from numeric to string. I deleted the dataset and created a new dataset from the adapter. The schema of the new dataset is good, but when I try to preview the data in the adapter I get an error saying the field is in bad format (still numeric) Do I have to create a new adaptor?

  7. #7
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    how are you creating the DataSet and DataAdapter? Are you just dragging and dropping them onto the form??? or are you creating them in code?

    Yes, if the first one.
    No, if the second.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  8. #8
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Being educated does not make you intelligent.

    Neither does being uneducated!!!

    Taxes.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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