473,387 Members | 1,721 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,387 software developers and data experts.

Sqldataadapter not accepting colums containing reserved word

Hi all

I ma having problem in sqldataadapter.

In my sql database i have one table containing column name as 'Name and
address'. Here 'and' is reserved word which i am using in column name.
In sql server at a time of inserting data into the table it is working
properly.

But when i try to insert data through sqldataadapter in C#, it is
giving me error
' incorrect syntax near and'.

what i want it to enclose column name in [] so that it should not give
me any kind of erro.

Is there any way for enclosing columns in p[] in sqldataadapter so that
i can fire insert query by using sqldataadapter.

Or is there any alternative for inserting data into such table through
c#.

Any help will be truely appreciated.

Thanks in advance.

Dec 30 '05 #1
1 1739
Hi,

You have to wrap your column in [] (you know that already) , how r u doing
it?

Post the code to better understand the problem.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"archana" <tr**************@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi all

I ma having problem in sqldataadapter.

In my sql database i have one table containing column name as 'Name and
address'. Here 'and' is reserved word which i am using in column name.
In sql server at a time of inserting data into the table it is working
properly.

But when i try to insert data through sqldataadapter in C#, it is
giving me error
' incorrect syntax near and'.

what i want it to enclose column name in [] so that it should not give
me any kind of erro.

Is there any way for enclosing columns in p[] in sqldataadapter so that
i can fire insert query by using sqldataadapter.

Or is there any alternative for inserting data into such table through
c#.

Any help will be truely appreciated.

Thanks in advance.

Dec 30 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matthew Cascio | last post by:
My understanding is that using reserved words as column names is allowable as long as they are quoted. I am trying to create a table dynamically with columns defined by the first row of a text...
5
by: Joy | last post by:
Hi guys, I am in a tricky situation, I really really hope someone will help me. I got a layout with a main container and three colums inside. Main container: 100% height; 90% width; float: left...
2
by: Jessard | last post by:
Hi All, I am writing a .NET app that accesses an access View. The view has a table column called 'Position'. When i try and right an UpdateCommand string for this using this column I am...
17
by: Benoit Martin | last post by:
I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset...
3
by: VK | last post by:
Just to realease my frustration: innocent "enum" is a reserved word in JScript! !@#$%^&* I occasionally discovered it just before I got ready to smash my computer over my head (some people...
1
by: languy | last post by:
Hi there I'm having a problem when using the SqlDataAdapter. When calling the Update(DataSet, string) method I get the following error message "String or binary data would be truncated". The...
31
by: metaperl | last post by:
-- python -i File "<stdin>", line 1 class = "algebra" ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class...
3
by: Robert | last post by:
I ask because, in Access help, it does not list is as such, however, I had a table with a field named 'Name'. If I put a control on a form and used this as the control source no problems, but if I...
2
by: Adrien Reboisson | last post by:
I'm trying to build a basic DB explorer using C# & Visual Studio 2005. I installed SQL Server 2005 Express, created a blank project, dropped a TreeView, a ListView and a DataGridView : DB objects...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.