473,465 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can i change columnames in a datatable

Hi

How can i change the columnames in a datatable. I am not using sql and i get
the datatable from a dataset.

The columnames in table "CustCont" is today "cc-custno1", "cc-custno2" and
"cc-class".

I think the "-" in the columnames gives me problem when doing
datatable.select() later on.

Please help

LarsE
Apr 27 '06 #1
1 11990
If you have chars like '-' in your column name you need to surround the
column name with [column] for the select (just like in SQL)

Aside from that you can change the column name using
http://msdn2.microsoft.com/en-US/lib...olumnname.aspx

Cheers,

Greg
"Lars E" <la***********@infocare.no> wrote in message
news:uD**************@TK2MSFTNGP05.phx.gbl...
Hi

How can i change the columnames in a datatable. I am not using sql and i
get the datatable from a dataset.

The columnames in table "CustCont" is today "cc-custno1", "cc-custno2" and
"cc-class".

I think the "-" in the columnames gives me problem when doing
datatable.select() later on.

Please help

LarsE

Apr 27 '06 #2

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

Similar topics

0
by: SoYouKnowBrig | last post by:
Hi All, I am using Microsoft.ApplicationBlocks.Cache.CacheManager to persist a System.Data.Dataset object. This Dataset object has a DataTable that is created from an existing DataTable using...
0
by: ad | last post by:
I use ado.net to fill a Excel wroksheet into a DataTable. The data in the Excel wroksheet is digital. After the data filled into the DataTable, the DataType of each column is set to Double, but...
2
by: Tor Inge Rislaa | last post by:
How to change row height in a DataGrid I have DataGrid that is filled with data from a table in a DataSet. The content of the cells is text of more than one line (as a note field). What I...
4
by: Rob Kroese | last post by:
I've got a form with a datagrid that displays a list of items, along with several textboxes, comboboxes, etc., that display the details for the selected item. The columns in the datagrid and the...
2
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's...
2
by: osmarjunior | last post by:
Is there a way to change manually the RowState property of a DataRow, in a DataTable?? I wanna create a DataTable in memory, so I do the following: DataRow row = tbl.DataTable.NewRow(); row =...
2
by: remya1000 | last post by:
i'm using VB.NET. and its a windows application. in my program i need to display a table in datagrid. so i created the table using DataTable and i'm calling that dataTable to dataGrid. and its...
6
by: cj | last post by:
If I'm sitting on a datarow for a customer and want to change his phone number only if it's blank what would I write? if myDr("phone")= "" then myDr("phone") = "mphone" endif...
2
by: wbw | last post by:
How can I rename an Access table from Excel VBA? I know <DoCmd.Rename "new_name", acTable, "old_name"> however the ending characters of the "old_name" will vary from database to database. I need to...
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...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.