The label doesnt want to display the variable

Morn

Active member
Joined
Dec 4, 2006
Messages
40
Programming Experience
Beginner
Hi guys/Girls,

I have a variable the stores a total cost the is received from a database (Access). What I am getting is an error saying that the value type Integer can not be displayed in a label, nor a text box, in fact any method of displaying it yields no result.

The code I am using is:

VB.NET:
Dim sqlsearch As String = "SELECT [totalcost] FROM tblBooking WHERE [customerID] =" & custID

        Dim command1 As New System.Data.OleDb.OleDbCommand(sqlsearch, myConnection)

        command1.Connection.Open()

        Dim rd As System.Data.OleDb.OleDbDataReader = command1.ExecuteReader()

        If rd.HasRows Then

            rd.Read()

            Me.cost = rd.Item("totalcost")

            rd.Close()

        End If

        priceLabel = cost
Cost being the variable name, this is in the form load block.

Any reason for this??

Thanks in advance
 
Back
Top