471,326 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 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 1661
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Matthew Cascio | last post: by
5 posts views Thread by Joy | last post: by
2 posts views Thread by Jessard | last post: by
3 posts views Thread by VK | last post: by
3 posts views Thread by Robert | last post: by

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.