473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Unable to locate the error

2
i am using following code.Its giving an error : "Syntax error in INSERT INTO statement"

Kindly tell me,where is the wrong in this code:

Expand|Select|Wrap|Line Numbers
  1. SqlString = "insert into UserMaster(Id,UserId,Password,Email,Telephone,Mobile,OrgId,UserTypeId,Blocked) Values (?,?,?,?,?,?,?,?,?)";
  2.         using (OleDbCommand comm = new OleDbCommand(SqlString, conn))
  3.         {
  4.             comm.CommandType = CommandType.Text;
  5.             comm.Parameters.AddWithValue("UserTypeId", DDLUserType.SelectedValue);
  6.             comm.Parameters.AddWithValue("Id", _Id);
  7.             comm.Parameters.AddWithValue("UserId", txtUserId.Text);
  8.             comm.Parameters.AddWithValue("Password", txtPassword.Text);
  9.             comm.Parameters.AddWithValue("Email", txtEmail.Text);
  10.             comm.Parameters.AddWithValue("Telephone", txtTelephone.Text);
  11.             comm.Parameters.AddWithValue("Mobile", txtMobile.Text);
  12.             comm.Parameters.AddWithValue("OrgId", DDLOrgID.SelectedValue);
  13.             comm.Parameters.AddWithValue("Blocked", 1);
  14.  
  15.             conn.Open();
  16.             int i = comm.ExecuteNonQuery();
  17.             conn.Close();
Apr 28 '10 #1
1 1013
Frinavale
9,735 Expert Mod 8TB
Your SQL Query is incorrect.
The VALUES part specifically.

Please review the following article that outline how to use a database:
Database tutorial Part 1
Database tutorial Part 2

-Frinny
Apr 28 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: TM | last post by:
When I run an ASP.Net application I am getting the following error: "Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged."...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
2
by: frbn | last post by:
hi all, we currently experience an original problem on a production server with a postgresql 7.1.3 ( a bit old, I know :\ ) We just want to know if somebody experienced this problem: the...
4
by: Abubakar | last post by:
Hi, I'm using vs2k5 vc++ (native/unmanaged). I just took a separate copy of a project from source control (vss) and after fixing its dependencies build it and it builds fine. But when I try to...
4
by: patelxxx | last post by:
I'm trying to use the DIV tag instead of the FORM tag which I'm currently using in my code to create a 'drop down list'. But I'm getting the ERROR: 'document.drop_list.locationID' is null or not an...
5
by: eranshuman | last post by:
Hi, I m very new to perl I m running an API which have the Buil.pl When Im compiling using perl Build.pl I was getting error : Can't locate Module/Build.pm in @INC (@INC contains:...
1
by: Markw | last post by:
Hi folks I think I've got a variable problem but not 100% sure. Background: I took the CMS example from chapter 6 in "Build your Own Database Driven Website Using PHP&MySQL" and have attempted to...
1
by: srikantvm | last post by:
Hi All, I am using perl, v5.8.8 built for MSWin32-x86-multi-thread and i tried installing the DBD-Oracle module but unable to install. Please find below the steps followed by me: 1) I first...
3
by: =?Utf-8?B?TGV3aXMgTW90ZW4=?= | last post by:
Hello. We are having a problem here trying to compile C# applications. Only one developer has a problem where they attempt to compile the application and the compiler complains about being out of...
0
by: squrel | last post by:
Hello All... I m getting this error in my project " Unable to locate record. verify that first column of view gird is unique" .. i have checked my gird and nothing wrong.. checked my database and ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.