473,815 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1753
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.goo glegroups.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
12388
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 file I import. Unfortunately, I have no control over the column names and the data provider has chosen to use the word "USE" as a column name. "USE" is a reserved word. To handle this, I tried quoting the word during the CREATE TABLE statement,...
5
8105
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 First colum: 100% height; 200px width; float: left Second colum: 100% height; 200px width; float: right Third colum: 100% height And here I stop, because nothing seems to work in order to set correctly
2
1787
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 greeted with a 'Syntax error in Update statement.' when attempting the update. I take that field out and the update works. I am assuming Position is a reserved word. I have even tried changing the name of the column in the View to something other...
17
3841
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 using the dataAdapter.update sub, I get an error. The problem seems to be that one of the fields was named 'desc' which is a reserved word for SQL. I've been able to work around this design flaw 'till now but it looks like the update sub can't...
3
2924
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 would enjoy I guess ;-) Maybe someone has her/his collection of "undocumented reserved words"
1
8076
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 rows neither have data that exceeds 8000 chars nor contain any LOB fields. Furthermore the data is transferred between two tables that are bitwise identical. -- snip -- System.Data.SqlClient.SqlCommand command =
31
3272
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 definition but class followed by equals is a simple assignment?
3
6055
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 used the field in a calculated control, i.e... =Trim() ... the control would display the name of the form. Error in help documentation?
2
16900
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 (Databases, tables, SPs, and so on) are displayed in the tree, table colums definitions in the list and I want to display the selected table content in the DataGridView. So far so good. Currently, I succedded in loading the treeview and the...
0
9737
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9613
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10147
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9227
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7689
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5712
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3032
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.