|
 |
ado_dotnet thread: Copy DataSet data to an Array
Message #1 by "MikeDumais" <pcmike@u...> on Sat, 14 Dec 2002 20:13:06
|
|
Hi everyone,
Has anyone had any luck with copying only the data of a DataSet to an
Array.
What I have is a dataset that contains string data. I want to create and
intialize the an array with this string data.
I have been using syntax like: dim arr1(dataset) as string
But this does not work.
any ideas?
Thanks in advance
Mike
Message #2 by "Mazen Alzogbi" <lists@a...> on Sun, 15 Dec 2002 01:59:25
|
|
Hi Mike,
I am not quite sure what's your question here so I will not give an answer
now.
The scenario as I got it is:
You have a DataSet Object that has a DataTable in it which contains all
string values. You want to create an array that has the same size of the
DataTable (Number of records in the DataTable) and populate it with the
values of that DataTable in the created Array.
Correct?
Mazen
> Hi everyone,
> Has anyone had any luck with copying only the data of a DataSet to an
A> rray.
W> hat I have is a dataset that contains string data. I want to create
and
i> ntialize the an array with this string data.
> I have been using syntax like: dim arr1(dataset) as string
> But this does not work.
> any ideas?
> Thanks in advance
> Mike
Message #3 by "Dumais, Mike" <mike.dumais@D...> on Sun, 15 Dec 2002 11:57:20 -0500
|
|
Hi Mazen,
That's correct.
This is a snippet of what I have working so far.
(This code fills a Dataset of CPT Codes based on codes from an array
(gT)that I iterate through)
For x=1 To 12
Me.oleDbSelectCPT.commandtext= "Select CPT FROM Table WHERE Key = '"
& gT(x) & "'"
Me.daCPT.Fill(DsCPT1)
Next
(Now I want to iterate through these CPT codes in the dataset in a similar
Commandtext as above to find the associated ICD9 codes and conditions. This
is why I'm trying to copy the Data in DsCPT1 to an array (MN). So if I
could create and initialize array MN with the DsCPT1 object, I would try the
following:
For x=0 To MN.length
Me.oleDbSelectMedNess.commandtext= "Select ICD9, Condition FROM Table
WHERE CPT = '" & MN(x) & "'"
Me.daMedNess.Fill(DsMedNess)
You may be asking yourself, why not just iterate through the Dataset instead
of creating an array. Well, I have had no luck with those attempts either.
I hope that sheds some light on what I'm trying to do.
Mike
-----Original Message-----
From: Mazen Alzogbi [mailto:lists@a...]
Sent: Saturday, December 14, 2002 8:59 PM
To: ADO.NET
Subject: [ado_dotnet] Re: Copy DataSet data to an Array
Hi Mike,
I am not quite sure what's your question here so I will not give an answer
now.
The scenario as I got it is:
You have a DataSet Object that has a DataTable in it which contains all
string values. You want to create an array that has the same size of the
DataTable (Number of records in the DataTable) and populate it with the
values of that DataTable in the created Array.
Correct?
Mazen
> Hi everyone,
> Has anyone had any luck with copying only the data of a DataSet to an
A> rray.
W> hat I have is a dataset that contains string data. I want to create
and
i> ntialize the an array with this string data.
> I have been using syntax like: dim arr1(dataset) as string
> But this does not work.
> any ideas?
> Thanks in advance
> Mike
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using ADO.NET
in your applications. The book covers DataSets and Typed DataSets, accessing
data using DataReaders and DataAdaptors, the close relationship between
ADO.NET and XML, how and where to use ADO.NET in your enterprise
applications, and how to use Web Services and ADO.NET to easily pass data
between applications.
http://www.wrox.com/books/1861007604.htm
Confidentiality Notice: This e-mail message, including any attachments, is
for the sole use of the recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
Message #4 by "Charles M. Carroll" <darthcarroll@l...> on Sun, 15 Dec 2002 12:52:53 -0500
|
|
http://www.learnasp.com/freebook/learn/utilitybelt.aspx
Check out:
sub arrayFromDataTableCommon(byref parray as object, dtblparm2 as datatable)
which does exactly what you want.
At 01:59 AM 12/15/2002 +0000, you wrote:
>Hi Mike,
>I am not quite sure what's your question here so I will not give an answer
>now.
>
>The scenario as I got it is:
>You have a DataSet Object that has a DataTable in it which contains all
>string values. You want to create an array that has the same size of the
>DataTable (Number of records in the DataTable) and populate it with the
>values of that DataTable in the created Array.
>
>Correct?
>
>Mazen
>
> > Hi everyone,
>
> > Has anyone had any luck with copying only the data of a DataSet to an
>A> rray.
>W> hat I have is a dataset that contains string data. I want to create
>and
>i> ntialize the an array with this string data.
>
> > I have been using syntax like: dim arr1(dataset) as string
>
> > But this does not work.
>
> > any ideas?
>
> > Thanks in advance
>
> > Mike
>===
>Fast Track ADO.NET with C# is a concise introduction to the concepts,
>techniques, and libraries that you will need in order to start using
>ADO.NET in your applications. The book covers DataSets and Typed DataSets,
>accessing data using DataReaders and DataAdaptors, the close relationship
>between ADO.NET and XML, how and where to use ADO.NET in your enterprise
>applications, and how to use Web Services and ADO.NET to easily pass data
>between applications.
>http://www.wrox.com/books/1861007604.htm
>---
>[This E-mail scanned for viruses by Declude Virus]
---
[This E-mail scanned for viruses by Declude Virus]
Message #5 by "Brian Smith" <bsmith@l...> on Mon, 16 Dec 2002 13:39:37 -0000
|
|
Apologiess for VB syntax, I use C, but what's wrong with this:
For x=0 To daCPT.Tables("Table").Rows.Count
Me.oleDbSelectMedNess.commandtext= "Select ICD9, Condition FROM
Table WHERE CPT = '" _
& daCPT.Tables("Table").Rows(x)("Column") & "'"
Me.daMedNess.Fill(DsMedNess)
DataSets already have iterators for all records and fields, so you don't
need to convert to an array.
Brian
-----Original Message-----
From: Dumais, Mike [mailto:mike.dumais@D...]
Sent: Sun, 15 Dec 2002 16:57
To: ADO.NET
Subject: [ado_dotnet] Re: Copy DataSet data to an Array
Hi Mazen,
That's correct.
This is a snippet of what I have working so far.
(This code fills a Dataset of CPT Codes based on codes from an array
(gT)that I iterate through)
For x=1 To 12
Me.oleDbSelectCPT.commandtext= "Select CPT FROM Table WHERE Key
= '" & gT(x) & "'"
Me.daCPT.Fill(DsCPT1)
Next
(Now I want to iterate through these CPT codes in the dataset in a
similar Commandtext as above to find the associated ICD9 codes and
conditions. This is why I'm trying to copy the Data in DsCPT1 to an
array (MN). So if I could create and initialize array MN with the
DsCPT1 object, I would try the
following:
For x=0 To MN.length
Me.oleDbSelectMedNess.commandtext= "Select ICD9, Condition FROM
Table WHERE CPT = '" & MN(x) & "'"
Me.daMedNess.Fill(DsMedNess)
You may be asking yourself, why not just iterate through the Dataset
instead of creating an array. Well, I have had no luck with those
attempts either.
I hope that sheds some light on what I'm trying to do.
Mike
-----Original Message-----
From: Mazen Alzogbi [mailto:lists@a...]
Sent: Saturday, December 14, 2002 8:59 PM
To: ADO.NET
Subject: [ado_dotnet] Re: Copy DataSet data to an Array
Hi Mike,
I am not quite sure what's your question here so I will not give an
answer
now.
The scenario as I got it is:
You have a DataSet Object that has a DataTable in it which contains all
string values. You want to create an array that has the same size of the
DataTable (Number of records in the DataTable) and populate it with the
values of that DataTable in the created Array.
Correct?
Mazen
> Hi everyone,
> Has anyone had any luck with copying only the data of a DataSet to an
A> rray.
W> hat I have is a dataset that contains string data. I want to create
and
i> ntialize the an array with this string data.
> I have been using syntax like: dim arr1(dataset) as string
> But this does not work.
> any ideas?
> Thanks in advance
> Mike
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
to unsubscribe send a blank email to Confidentiality
Notice: This e-mail message, including any attachments, is for the sole
use of the recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 06/12/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 06/12/2002
Message #6 by "Dumais, Mike" <mike.dumais@D...> on Mon, 16 Dec 2002 12:15:46 -0500
|
|
Thanks for the reply Brian.
I'll try it today
Thanks again
-----Original Message-----
From: Brian Smith [mailto:bsmith@l...]
Sent: Monday, December 16, 2002 8:40 AM
To: ADO.NET
Subject: [ado_dotnet] Re: Copy DataSet data to an Array
Apologiess for VB syntax, I use C, but what's wrong with this:
For x=0 To daCPT.Tables("Table").Rows.Count
Me.oleDbSelectMedNess.commandtext= "Select ICD9, Condition FROM
Table WHERE CPT = '" _
& daCPT.Tables("Table").Rows(x)("Column") & "'"
Me.daMedNess.Fill(DsMedNess)
DataSets already have iterators for all records and fields, so you don't
need to convert to an array.
Brian
-----Original Message-----
From: Dumais, Mike [mailto:mike.dumais@D...]
Sent: Sun, 15 Dec 2002 16:57
To: ADO.NET
Subject: [ado_dotnet] Re: Copy DataSet data to an Array
Hi Mazen,
That's correct.
This is a snippet of what I have working so far.
(This code fills a Dataset of CPT Codes based on codes from an array
(gT)that I iterate through)
For x=1 To 12
Me.oleDbSelectCPT.commandtext= "Select CPT FROM Table WHERE Key
= '" & gT(x) & "'"
Me.daCPT.Fill(DsCPT1)
Next
(Now I want to iterate through these CPT codes in the dataset in a
similar Commandtext as above to find the associated ICD9 codes and
conditions. This is why I'm trying to copy the Data in DsCPT1 to an
array (MN). So if I could create and initialize array MN with the
DsCPT1 object, I would try the
following:
For x=0 To MN.length
Me.oleDbSelectMedNess.commandtext= "Select ICD9, Condition FROM
Table WHERE CPT = '" & MN(x) & "'"
Me.daMedNess.Fill(DsMedNess)
You may be asking yourself, why not just iterate through the Dataset
instead of creating an array. Well, I have had no luck with those
attempts either.
I hope that sheds some light on what I'm trying to do.
Mike
-----Original Message-----
From: Mazen Alzogbi [mailto:lists@a...]
Sent: Saturday, December 14, 2002 8:59 PM
To: ADO.NET
Subject: [ado_dotnet] Re: Copy DataSet data to an Array
Hi Mike,
I am not quite sure what's your question here so I will not give an
answer
now.
The scenario as I got it is:
You have a DataSet Object that has a DataTable in it which contains all
string values. You want to create an array that has the same size of the
DataTable (Number of records in the DataTable) and populate it with the
values of that DataTable in the created Array.
Correct?
Mazen
> Hi everyone,
> Has anyone had any luck with copying only the data of a DataSet to an
A> rray.
W> hat I have is a dataset that contains string data. I want to create
and
i> ntialize the an array with this string data.
> I have been using syntax like: dim arr1(dataset) as string
> But this does not work.
> any ideas?
> Thanks in advance
> Mike
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
to unsubscribe send a blank email to Confidentiality
Notice: This e-mail message, including any attachments, is for the sole
use of the recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 06/12/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 06/12/2002
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using ADO.NET
in your applications. The book covers DataSets and Typed DataSets, accessing
data using DataReaders and DataAdaptors, the close relationship between
ADO.NET and XML, how and where to use ADO.NET in your enterprise
applications, and how to use Web Services and ADO.NET to easily pass data
between applications.
http://www.wrox.com/books/1861007604.htm
Confidentiality Notice: This e-mail message, including any attachments, is
for the sole use of the recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
|
|
 |