VB.NET-APP Strange Error Inside.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nexusbr
    New Member
    • Dec 2007
    • 15

    VB.NET-APP Strange Error Inside.

    Hello all..

    here is the scenario:
    I Have a fully working vb.net 2005 app and firebird..
    everything is perfectly, except this little function:
    Code:
            dim dr, dr1 as FbDataReader
            dr = reader("select * from net_saldo where b.codigo=" & user)
            If dr.Read() Then
                dr1 = reader("Select out,pc from net_ac where user=" & user)
                While dr1.Read
                    l.Items.Add(Format(dr1.GetDateTime(0), "dd/MM/yyyy") & " - " & dr1.GetString(1))
                End While
            Else
                l.Items.Add("Saldo: R$ 0,00")
            End If
    Here is the reader function code:

    Code:
    Public Function reader(ByVal sql As String) As FbDataReader
            Dim cm As New FbCommand
            cm.Connection = fb
            cm.CommandText = sql
            reader = cm.ExecuteReader
    End Function
    The error i'm getting is:

    "Conversion error from string SYSDBA"

    on the line: While dr1.read

    it executes the reader function for the second time with no errors, but when it try to read the datareader the error pops up.

    I've never seen such error before...

    the error persists even when i use a different conection/reader_function/datareader_obje ct..

    this makes no sense at all..

    .... please help.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Is that string valid? I am unfamiliar with the database type you are querying but it sounds like it doesn't like the format of one of your SELECT statements there.

    Unless you are mistaken on the line and it's really having trouble with:
    l.Items.Add(For mat(dr1.GetDate Time(0), "dd/MM/yyyy") & " - " & dr1.GetString(1 ))

    Comment

    • nexusbr
      New Member
      • Dec 2007
      • 15

      #3
      Yes, the string is valid.

      no, the line is correct.

      SYSDBA is the name of the user connected to the database.

      the sql statment is correct, unless i'm blind..

      i'm kinda lost here... never happend such a thing before..


      it does not even step into the while loop.. the error could be on second tick.. but no..

      Comment

      • nexusbr
        New Member
        • Dec 2007
        • 15

        #4
        oh.. wait.. the same error happened on ibexpert also.. now i guess its a little easier to find out.. let me check it..

        Comment

        • nexusbr
          New Member
          • Dec 2007
          • 15

          #5
          Ok...


          Problem Solved..

          Sorry For taking your time.. it was my mistake..

          the column name 'user' was conflicting with the firebird system, making it thinks i was trying to access the database with a different user...

          thx for the help.

          Comment

          Working...