473,385 Members | 1,736 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.

filling an array from a dataset

Hello,

How can I declare an array, and set it to equal all the items in a column of
a dataset?

TIA,

Amber
Sep 24 '05 #1
4 1479
Amber,

A dataset has no column, what do you mean?

Cor
Sep 24 '05 #2
CT
I assume you want to copy the rows from a table in the DataSet, right? If
so, you need to manually loop through the rows and copy across to the array.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

"amber" <am***@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Hello,

How can I declare an array, and set it to equal all the items in a column
of
a dataset?

TIA,

Amber

Sep 24 '05 #3
can you explain how to do that?

"CT" wrote:
I assume you want to copy the rows from a table in the DataSet, right? If
so, you need to manually loop through the rows and copy across to the array.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

"amber" <am***@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Hello,

How can I declare an array, and set it to equal all the items in a column
of
a dataset?

TIA,

Amber


Oct 24 '05 #4
CT
Here's one way:

' Populate dataset
SqlDataAdapter1.Fill(dataset1, "Categories")

' Create and dimension row array
Dim rows(dataset1.Tables("Categories").Rows.Count) As DataRow
' Loop through all rows in Categories table
For i As Integer = 0 To dataset1.Tables("Categories").Rows.Count - 1
rows(i) = dataset1.Tables("Categories").Rows(i)
Next

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

"Cath" <Ca**@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
can you explain how to do that?

"CT" wrote:
I assume you want to copy the rows from a table in the DataSet, right? If
so, you need to manually loop through the rows and copy across to the
array.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

"amber" <am***@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
> Hello,
>
> How can I declare an array, and set it to equal all the items in a
> column
> of
> a dataset?
>
> TIA,
>
> Amber


Oct 24 '05 #5

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

Similar topics

1
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the...
5
by: Cybertof | last post by:
Hello, Is it necessary to initially fill a dataset to be able to add a new row to the dataset and then update the undercover database ? (In the case of a very large database, this would mean...
1
by: Krzysztof Karnicki | last post by:
I have such a problem… I have create my custom DataGridColumn inheriting from System.Windows.Forms.DataGridColumnStyle on using it on DataGrid, to show rows painted by me self. Because dates ...
3
by: crjunk | last post by:
I have a 3 table in my DataSet that I'm filling with data. After I've filled these 3 tables, I'm then trying to run a query that will fill a 4th table in the DataSet with data from the three...
4
by: amber | last post by:
Hello, How can I declare an array, and set it to equal all the items in a column of a dataset? TIA, Amber
4
by: gillcleeren | last post by:
I have a datagrid that has to be filled in a WinForms application. The data comes from an Oracle database. The normal procedure would be filling a dataset, but I have the problem that there are...
0
by: Derek Vincent | last post by:
Why am I having problems filling my dataset when I select fields of type varchar(350) from interbase? I can fill the dataset when I select every other field in the table but I receive and error...
1
by: WayneM | last post by:
I have compact framework app that I was trying to test out on a windows form, but I cannot get past the very first step of simply filling a DataGrid from a DataSet. My code is Dim sqlStmt As...
11
by: Sid Price | last post by:
I have Dataset that I need to filter into another Dataset for display and I can not find out how to do this. I have found methods for copying a Dataset but I can not see how to filter the rows...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.