InvalidComObjectException help??

dicky18

Member
Joined
Sep 22, 2005
Messages
23
Location
bangkok
Programming Experience
Beginner
hello there im facing a problem in vs.net 2005 that didnt occur in 2003
i am adding data to a data grid on runtime but im reading some data first
this is my code
VB.NET:
PublicFunction ordertotal()
UP.Connection = Me.OleDbConnection1
UP.CommandType = CommandType.Text
UP.CommandText = "SELECT SUM(LineTotal) AS Total FROM(CustomerOrder_Details)WHERE OrderID=[@OrderID];"
UP.Parameters.Add("@OrderID", Data.OleDb.OleDbType.Variant)
UP.Parameters("@OrderID").Value = Int32.Parse(Me.txtOrderId.Text)
UP.Connection.Open()
Read = UP.ExecuteReader() <===InvalidComObjectExeption(COM object that has been separated from its underlying RCW)
While (Read.Read())
Dim check AsString
Me.txtordertotal.Text = Read("Total").ToString()
 
 
EndWhile 
UP.Connection.Close()
EndFunction
If some one has an idea how to fix it thanks in advance
 
Last edited by a moderator:
Back
Top