Results 1 to 6 of 6

Thread: any ideas

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Location
    Ohio. United States of America
    Posts
    96

    any ideas

    Below is my code:

    I need the information from the table to output to message box...

    Try
    tempCardNum = ds.Tables("cardInfo").Rows(0).Item("cardNum")
    tempdateScanned = ds.Tables("cardInfo").Rows(0).Item("dateScanned")
    tempassocNum = ds.Tables("cardInfo").Rows(0).Item("assocNum")
    MsgBox("Card Found, The Details: " & tempCardNum & "'" & tempdateScanned & "'" & tempassocNum & "'", MsgBoxStyle.Exclamation)
    Catch ex1 As Exception
    MsgBox("Card Not Found - Any Problems Please Contact Your System Administrator", MsgBoxStyle.Information)
    End Try

    Cant get the 3 columns from my table to show in message box...

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    What does it do?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Location
    Ohio. United States of America
    Posts
    96

    goes to the catch

    the program shows msgbox after the catch. It says card not found. the card is definately in the db.

    at the beginning of my code i use this statement:

    MySql1String = "select * from cardInfo where cardNum = '" & txbxGiftCardNumSearch.Text & "' "

    here is the rest of it...


    Try
    strSQL = "data source=glsql01;integrated security = sspi;persist security info = false;initial catalog=GiftCard"
    osqlconn = New SqlConnection(strSQL)
    osqlconn.Open()
    da = New SqlClient.SqlDataAdapter(MySql1String, osqlconn)
    da.Fill(ds, "cardInfo")
    osqlconn.Close()
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try

    Try
    tempCardNum = ds.Tables("cardInfo").Rows(0).Item("cardNum")
    tempdateScanned = ds.Tables("cardInfo").Rows(0).Item("dateScanned")
    tempassocNum = ds.Tables("cardInfo").Rows(0).Item("assocNum")
    MsgBox("Card Found, The Details: " & tempCardNum & "'" & tempdateScanned & "'" & tempassocNum & "'", MsgBoxStyle.Exclamation)
    Catch ex1 As Exception
    MsgBox("Card Not Found - Any Problems Please Contact Your System Administrator", MsgBoxStyle.Information)
    End Try

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Do an msgbox(ex1.Message) to see the REAL error message. The report back with the error.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Location
    Ohio. United States of America
    Posts
    96

    thanks

    you know, sometimes the most simple thing...

    I had a column name different - ooops...

    I appreciate ya help - thanks


  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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