473,385 Members | 2,044 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,385 software developers and data experts.

REPOST System.Data.DataTable


This works:

Dim dt As System.Data.DataTable
Dim r As System.Data.DataRow = dt.Rows.Item(i)
i = r.Item(2)

But, I would like to retirive column value by entering
column name not by index ( r.Item(2)
). The problem is that I don't know column name and I would like somehow to
list all column names of DataTable. How can I do that?

Please help and sorry for incomplete info.
Mar 5 '08 #1
4 1209
r = dt.Rows(i)
i = r("FieldName")

Not too hot on VB.net, you might need;

i = r.Item("FieldName")

"John Smith" <jo********@microsoft.comwrote in message
news:2i*******************@news.siol.net...
>
This works:

Dim dt As System.Data.DataTable
Dim r As System.Data.DataRow = dt.Rows.Item(i)
i = r.Item(2)

But, I would like to retirive column value by entering
column name not by index ( r.Item(2)
). The problem is that I don't know column name and I would like somehow
to
list all column names of DataTable. How can I do that?

Please help and sorry for incomplete info.

Mar 5 '08 #2

The problem is that I don't know field name. :(
Mar 5 '08 #3

"John Smith" <jo********@microsoft.comwrote in message
news:O3*******************@news.siol.net...
>
The problem is that I don't know field name. :(
Sorry, didn't read the question. To get all the column names (sorry it's in
c#)

foreach (DataColumn col in dt.Columns)

{

string name = col.ColumnName;

}
Mar 5 '08 #4
foreach (DataColumn col in dt.Columns)
>
{

string name = col.ColumnName;

}
Thank you. I will try that.
Mar 5 '08 #5

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

Similar topics

0
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
6
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
2
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
0
by: elcc1958 | last post by:
I need to support a VB6 application that will be receiving disconnected ADODB.Recordset from out DotNet solution. Our dotnet solution deals with System.Data.DataTable. I need to populate a...
0
by: nima | last post by:
Hi I have two tables in my database. PRODUCT and PRODUCT_GROUP. PRODUCT has a foreign key to PRODUCT_GROUP. I generated a typed dataset using VS.net and added a relationship between the two...
0
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows...
2
by: sxiao | last post by:
Hi, there I got a NullReferenceException when there are more than one users trying to open the same page at the same time. The senerio is: Two users logged into the web application using the...
7
by: Mythran | last post by:
Been 11 days since I posted this and 0 replies (although, in OE, it looks like there was 1 but it's just another post with the same subject as before): Part #1: I have a Thread, MainThread, and...
4
by: Dariusz Tomon | last post by:
Hello I upgraded my project from Visual Studio 2003 to 2005. The upgrade was performed with no errors but now when I try to build my project (now it's in ..NET 2.0 not .NET 1.1 as was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.