473,511 Members | 15,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic columns in DataSet?

I'm looping through a DataSet with this code:

Dim myDataRow As DataRow

For Each myDataRow In myDataSet.Tables("ReportRows").Rows
Dim row As WorksheetRow = sheet.Table.Rows.Add
cell = row.Cells.Add

cell.Data.Text = myDataRow("Account").ToString()
Next

I want to get the values from each column also without knowing their
name. In the code above I get the value from the Account column but I
want a dynamic solution where I don't write the name of the column. Is
that possible?

Regards,

S

Mar 15 '06 #1
1 1647
Hi staeri,

You can use etiher

myDataRow("Account")

or

myDataRow(column_index)

HTH

Elton Wang

"st****@gmail.com" wrote:
I'm looping through a DataSet with this code:

Dim myDataRow As DataRow

For Each myDataRow In myDataSet.Tables("ReportRows").Rows
Dim row As WorksheetRow = sheet.Table.Rows.Add
cell = row.Cells.Add

cell.Data.Text = myDataRow("Account").ToString()
Next

I want to get the values from each column also without knowing their
name. In the code above I get the value from the Account column but I
want a dynamic solution where I don't write the name of the column. Is
that possible?

Regards,

S

Mar 15 '06 #2

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

Similar topics

0
1342
by: JP011 | last post by:
Hello I have hit a major road block when it comes to building my dynamic datagrid. To make a long story short I need a dynamic datagrid because my connection string could change and I need the...
1
4074
by: Fresh Air Rider | last post by:
Hello Does anyone know how to display data from a data source such as an array or SqlDataReader or XML etc within an HTML table whose number of columns can change according to the value of a...
1
2516
by: Arpan | last post by:
The following code snippet creates a DataSet on the fly which is then passed to a DataView so that the DataSet can finally be viewed in a DataGrid control: 'Create the empty DataSet Dim objDS As...
0
1684
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
7
1776
by: CanoeGuy | last post by:
I have been trying for the last two weeks to display a dynamic DataGrid. The data that I'm pulling from a SQL Server DB will have whole columns that will be either NULL or 0. I want to display...
3
14428
by: BartMan | last post by:
Greetings, I have a gridview which is sitting on a multi view control (witin a view), and it is bound to a dataset which I dynamically apply to the control within asp.net page. The problem is...
1
6978
by: Lacutas | last post by:
Hi I'm having some problems getting a dynamic LINQ query to work on my DataSet. The idea is that a user selects certain criteria, and then the LINQ query filters through the dataset making the...
2
2997
by: DaveL | last post by:
Hello I want to build Dynamic Paramers for a Sql Insert below is what i have so far but...determinthe column type and length im having Problems with Tks dave string sInsert = "Insert into...
3
4253
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I think this question was discused quite often before. But maybe some "good-brain" has a great idea ... :-))) I have a DataSet with "unknown" columns. The CLR Function should work...
0
2708
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
7252
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
7432
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
7517
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
5676
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
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
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 ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.