473,382 Members | 1,545 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,382 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 1478
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.