Data type mismatch
Hi all,
I am trying to create a connection for the datareader to access the database but seem to be getting a series of errors when trying different alternatives. At the moment I seem to be getting one particular error of Data Type Mismatch. Please see the following code: -
Sub BindShoppingBasket
DBConnection = New OleDbConnection ( _
ConfigurationSettings.AppSettings("ConnectionStrin g"))
SQLString = "SELECT * FROM ShopBasket INNER JOIN Products " & _
"ON ShopBasket.ItemNumber = Products.ItemNumber " & _
"WHERE OrderNumber = '" & Session("OrderNumber") & "' " & _
"ORDER BY ShopBasket.ItemNumber"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBConnection.Open()
DBReader = DBCommand.ExecuteReader()
ShoppingBasket.DataSource = DBReader
ShoppingBasket.DataBind()
DBConnection.Close()
If OrderTotal > 0 Then
ChangeOrderMessage.Visible = True
CustomerID.Value = Session("OrderNumber")
OrderAmount.Value = FormatNumber(OrderTotal, 2)
End If
DateOut.Text = Today
OrderOut.Text = Session("OrderNumber")
CustomerID.Value = Session("OrderNumber")
End Sub
Does anyone have any suggestions on how I get round this error or explain why this keeps happening.
Thanks
Sharon
|