borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Please help me)Next Topic (how to share databases) New Topic New Poll Post Reply
AndreaVB Forum : Database : myreader problem
Poster Message
bshaen
Level: Sage

Registered: 11-01-2005
Posts: 58

icon myreader problem

display = "SELECT AlbumName,Category, QOH, MinLevel, Price, [Profit%] UserID FROM AlbumRec WHERE AlbumID = '" & found & "'"
                mySqlCommand = New SqlCommand(display, mySqlConnection)
                myReader = mySqlCommand.ExecuteReader
                lblRecord.Text = add

                If (myReader.Read()) Then

                    locked = myReader.Item("UserID").ToString.Trim
                    ALbumname = myReader.Item("AlbumName").ToString
                    Category = myReader.Item("Category").ToString
                    Qoh = myReader.Item("QOH").ToString()
                    minLevel = myReader.Item("MinLevel").ToString()
                    netprice = myReader.Item("Price").ToString()
               profit = myReader.Item("[Profit%]").ToString()

                    newRecord = False
                    myReader.Close()
                end if

i have successly to run the sqlcommand, but i am failly to get the value in myreader. the error occur, "[profit%]". so can anyone help me to solve this prob?? i am appreciated if u guy may help me to solve it, thank...thank a lot!!  

[Edited by bshaen on 10-01-2006 at 04:11 PM GMT]

____________________________
bshaen

10-01-2006 at 12:07 PM
View Profile Send Email to User Show All Posts Visit Homepage ICQ | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: myreader problem

Just a quick thought on this one.
It could be something to do with the "%" in your Field name. Try changing the Field Name to "ProfitPC" and see if that makes a difference.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

10-01-2006 at 04:37 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : myreader problem
Previous Topic (Please help me)Next Topic (how to share databases) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder