Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2006, 07:35 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with syntax

hei guys,

this is the error i'm getting in my browser :
Data type mismatch in criteria expression.
.....
Line 364: SQL.ExecuteNonQuery()

& here's my code :

Dim mDelivery, mDiscount, mSubtotal, mTax, mTotal As Double
........
SQL.Parameters.Clear() ' Clear the parameters buffer else error

SQL.CommandText = "UPDATE Orders SET PromotionCode = @promocode, " & _
"Completed = TRUE, DateTimeCompleted = @TimeNow, Subtotal = @subtotal, " & _
"Total = @Total, Tax = @Tax, Delivery = @Delivery, Discount = @Discount " & _
"Where OrderID = @OrderIdentification"

        SQL.Parameters.Add(New OleDb.OleDbParameter("Promocode", txtPromotionalCode.Text))
        SQL.Parameters.Add("TimeNow", Now)
        SQL.Parameters.Add("subtotal", mSubtotal)
        SQL.Parameters.Add("Total", mTotal)
        SQL.Parameters.Add("Tax", mTax)
        SQL.Parameters.Add("Delivery", mDelivery)
        SQL.Parameters.Add("Discount", mDiscount)
        SQL.Parameters.Add("OrderIdentification", Session("OrderID"))
        SQL.ExecuteNonQuery()

I'm kinda stumped trynna get this to work, so mabey someone could either point out any syntax errors or throw any hints my way as to whats going wrong.
Mabey i'm missing some single quotes ' ' around certain values (such as time), or my MS Access database needs number values to be rounded to 2 decimal places or in a currency format.....

any comments appreciated
thx,
mark



 
Old November 30th, 2006, 07:42 AM
Authorized User
 
Join Date: Sep 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi , where u are getting the values. If its in TextBox's . U must cast to appropriate type.
Like
   int.parse(txtOrderID.Text)






Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax problem with SQL nancy SQL Server 2000 4 May 6th, 2005 12:56 PM
Syntax Problem Please i need your help haron_Master VB Databases Basics 4 February 2nd, 2005 01:56 PM
xpath syntax problem nrane26 XSLT 1 January 22nd, 2005 01:25 PM
Query syntax problem mateenmohd Access 2 October 12th, 2004 11:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.