Hi All,
I have a need to create a generic DataTable using data in a 2D array of
strings (I do not have direct access to the database, and am given the data
via another program that I do not have control over).
Is there a quicker, more efficient way to do it besides creating an empty
DataTable and creating and appending DataRows?
Thanks,
pagates 4 10443
pagates,
Not really, but it would be easy to create a function that takes the
array, the columns you want each element in the array to be populated with,
and then create the data table. You could then reuse this over and over.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"pagates" <pa*****@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com... Hi All,
I have a need to create a generic DataTable using data in a 2D array of strings (I do not have direct access to the database, and am given the data via another program that I do not have control over).
Is there a quicker, more efficient way to do it besides creating an empty DataTable and creating and appending DataRows?
Thanks, pagates
I suppose the same theory would be true for a DataAdapter...
Thanks,
pagates
"Nicholas Paldino [.NET/C# MVP]" wrote: pagates,
Not really, but it would be easy to create a function that takes the array, the columns you want each element in the array to be populated with, and then create the data table. You could then reuse this over and over.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pagates" <pa*****@discussions.microsoft.com> wrote in message news:26**********************************@microsof t.com... Hi All,
I have a need to create a generic DataTable using data in a 2D array of strings (I do not have direct access to the database, and am given the data via another program that I do not have control over).
Is there a quicker, more efficient way to do it besides creating an empty DataTable and creating and appending DataRows?
Thanks, pagates
Do you mean creating a data adapter which wraps around a two-dimensional
array? I don't know that it would, because a data adapter would require
commands to query/update/insert/delete records.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"pagates" <pa*****@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com... I suppose the same theory would be true for a DataAdapter...
Thanks, pagates
"Nicholas Paldino [.NET/C# MVP]" wrote:
pagates,
Not really, but it would be easy to create a function that takes the array, the columns you want each element in the array to be populated with, and then create the data table. You could then reuse this over and over.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pagates" <pa*****@discussions.microsoft.com> wrote in message news:26**********************************@microsof t.com... > Hi All, > > I have a need to create a generic DataTable using data in a 2D array of > strings (I do not have direct access to the database, and am given the > data > via another program that I do not have control over). > > Is there a quicker, more efficient way to do it besides creating an > empty > DataTable and creating and appending DataRows? > > Thanks, > pagates
Hi Nicholas,
I was just "thinking out loud."
I am adapting a project that currently uses Odbc-based stuff
(OdbcDataReader, OdbcDataAdapter, etc.) to be able to instead use the data
returned in a 2-D string array instead. A lot less elegant, and we won't
know column names, etc. (at least, without doing some "magic" with queries).
Basically, its a new project based upon old technology. I used the Odbc
classes to "get it working" (the stuff that relies on the data) and now need
to backfill with the old stuff to get the actual data.
Thanks,
Paul
"Nicholas Paldino [.NET/C# MVP]" wrote: Do you mean creating a data adapter which wraps around a two-dimensional array? I don't know that it would, because a data adapter would require commands to query/update/insert/delete records.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pagates" <pa*****@discussions.microsoft.com> wrote in message news:ED**********************************@microsof t.com...I suppose the same theory would be true for a DataAdapter...
Thanks, pagates
"Nicholas Paldino [.NET/C# MVP]" wrote:
pagates,
Not really, but it would be easy to create a function that takes the array, the columns you want each element in the array to be populated with, and then create the data table. You could then reuse this over and over.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"pagates" <pa*****@discussions.microsoft.com> wrote in message news:26**********************************@microsof t.com... > Hi All, > > I have a need to create a generic DataTable using data in a 2D array of > strings (I do not have direct access to the database, and am given the > data > via another program that I do not have control over). > > Is there a quicker, more efficient way to do it besides creating an > empty > DataTable and creating and appending DataRows? > > Thanks, > pagates This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mountain Bikn' Guy |
last post by:
When one gets a row from a database (ie, a DataTable), the row contains a
typed value in each column. How is this typically implemented behind scenes.
I want to build this functionality myself. The...
|
by: Fredrik Rodin |
last post by:
All,
I've been looking around for a solution to my problem for a couple of days
now.
In short, here's my situation:
1.
I'm getting a result from a component back as a datatable and I have...
|
by: Chris Ericoli |
last post by:
Hi,
I am working with an 'in session' ado dataset with an asp.net application.
My dataset is comprised of two tables, one of which maintains a few
calculated datacolumns. For some reason these...
|
by: Rui Sampainho |
last post by:
Hi
Is there any command to transfer the contents of a datatable to an array.
What I'm looking for is sort of a bulk process, not an iteration with a loop
based on a field by field or row by row...
|
by: Niyazi |
last post by:
Hi all,
I have a dataTable that contains nearly 38400 rows.
In the dataTable consist of 3 column.
column 1 Name: MUHNO
column 2 Name: HESNO
Column 3 Name: BALANCE
Let me give you some...
| |
by: Niyazi |
last post by:
Hi everyone,
I have 5 string in my array that I get from MS Access DB.
Public mDov(0) as string and I fill with my for loop. The result as shown
below
mDov(0) = "ABC_01"
mDov(1) = "ABC_02"...
|
by: Maxwell2006 |
last post by:
Hi,
I am working with strongly typed datatables.
What is the most efficient way to build a new DataTAble based on the result
of DataTable.Select?
At this point I use a foreach loop to do the...
|
by: Paulers |
last post by:
Hello,
I have a string that I am trying to add each char to a datatable row.
for example if I have a string that looks like "abcdefg", I would like
to break it up into an array of characters...
|
by: Anish G |
last post by:
Hi,
I have an issue with reading CSV files.
I am to reading CSV file and putting it in a Datatable in C#. I am using a regular expression to read the values. Below is the code. Now, it reads...
|
by: John Dann |
last post by:
Is there a concise/efficient way to retrieve blocks of rows from a
datatable with VB2005?
I've got a datatable (let's call it AllData), constructed
programmatically, that contains a lot of...
|
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,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: 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,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |