473,657 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Move Array To Table

VS 2003 .NET 1.1

What is the fastest way to move 2 dimensional Array of objects into a
DataTable, besides using a loop?
I have a about 30,000 elements in my array and I have to move it into a
DataTable

Thank You

Peter
Jun 28 '06 #1
10 9295
Peter,
Basically you need to keep doing DataTable.NewRo w, so I don't think there is
an alternative. e.g. (pseudocode):

DataRow row;
foreach(item in myArray)
{
row=MyTable.New Row();
row.ItemArray= item // assuming they match the columns, or whatever
MyTable.Rows.Ad d(row);
}

--Peter

}
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter" wrote:
VS 2003 .NET 1.1

What is the fastest way to move 2 dimensional Array of objects into a
DataTable, besides using a loop?
I have a about 30,000 elements in my array and I have to move it into a
DataTable

Thank You

Peter

Jun 28 '06 #2
Hi Peter,

Thanks for your post!

I agree with pbromberg that .Net FCL does not provide interface to import 2
dimensional array into DataTable. You have to loop through the Array to add
them row by row.

Yes, I see that there are a lot of elements in the array, so the importing
may have some impact on the performance. I think you'd better use certain
type of delay import in the design to reduce the performance impact. For
example, you seldom display all the elements in the GUI, so you may paging
all the elements in several sections, and import and display one section at
a time.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 29 '06 #3
Hi Peter,

Does reply make sense to you? Do you still have any concern regarding it?
Please feel free to tell me, thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 3 '06 #4

""Jeffrey Tan[MSFT]"" <je***@online.m icrosoft.comwro te in message
news:Ek******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Peter,

Does reply make sense to you? Do you still have any concern regarding it?
Please feel free to tell me, thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.

I have found a solution at
http://www.codeproject.com/cs/databa...dArrayGrid.asp where you can move
2 dimensional array to DataGrid, unfortunately I can not figure out how to
change the GridColumnStyle so I can format individual cells. I have asked
the author "How do I apply column styles to a DataGrid that uses
ArrayDataView instead of DataSet", but he does not respond.

Even though I am displaying only 10 by 20 grid (10 rows by 20 columns) I
have to give the user an ability to scroll to any part of the table very
fast and this table might contain up to 7,000 columns so I can not put this
into Access Table.
Thank you
Peter
Jul 3 '06 #5
Hi Peter,

Have you tried my sample project? Does it meet your need? Please feel free
to tell me, thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 7 '06 #6

""Jeffrey Tan[MSFT]"" <je***@online.m icrosoft.comwro te in message
news:aR******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Peter,

Have you tried my sample project? Does it meet your need? Please feel free
to tell me, thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.
What sample project are you referring to?
Jul 12 '06 #7
Hi Peter,

I have added a reply to you in Tue, 04 Jul 2006. I performed some search in
google and found that it is missed in groups.google.c om, so I suspect it is
missed in the newsgroup, however, I still can see it in our internal suppor
tool. Anyway, I will paste that reply here:

"Hi Peter,

Thanks for your feedback!

DataGrid does not support formatting for individual cells, it can only
apply formatting at column level with DataGridTextBox Column.Format and
FormatInfo properties.

To customize ArrayDataView for supporting DataGridTextBox Column, I have
provided you some guide line in the link below:
http://groups.google.com/group/micro...es.csharp/msg/
363eb3e9931a404 1?hl=zh-CN&

To demonstrate my statement, I have modified that project regarding the
guide I provided. In the sample project, I set
DataGridTextBox Column.Format=" c", so that all the cells will display
currency style of value.

I have attached my modified sample project in this reply. You can download
it with Outlook Express, not IE.

I am not sure I understand your second completely. Why do you mention
"Access Table"? I did not suggest you put the data in "Access Table". What
I was suggestion is that: since your data is huge, if you are binding all
the data with DataGrid, the initial databinding and displaying time will be
significant long, which gives the end user a not good experience on your
application. So it is better to introduce certain type of paging in
databinding. That is divide all your data into several sections, and only
bind 1 section of data with DataGrid, and provide another "Next Page"
button for the user, which will load next section of data and bind with the
DataGrid for displaying. This will improve the performance and GUI
significantly.

Anyway, if you have good reason to not use paging, you can remain the
current design.

Hope this helps!"

Regarding the sample project, you may send an email to me, I will send you
that project. You may contact me at: je***@online.mi crosoft.com(remove
"online.")

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 13 '06 #8
Hi Peter,

Have you reviewed my last reply? Does it make sense to you? If you want,
please feel free to email me, I will send you the sample project. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 17 '06 #9

""Jeffrey Tan[MSFT]"" <je***@online.m icrosoft.comwro te in message
news:yf******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Peter,

Have you reviewed my last reply? Does it make sense to you? If you want,
please feel free to email me, I will send you the sample project. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.
What sample project are you referring to? (I don't see one)
Jul 17 '06 #10

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

Similar topics

17
3846
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a "table" insert in my "editable region", have it placed in the "center" of the page.. while it display correctly on my browser, with setting at 1024x768 (IE6),
2
1997
by: John | last post by:
The following code works OK in IE 6.0 but does not work in Netscape 7. The image does not shift when one scrolls down but stays stationary in Netscape. Please help Thank you John function moveImage(e){ //shift image according to scroll
14
3588
by: Peter | last post by:
Is there a fast way to move data from DataTable into double array, or do I have to spin through every record and column? I have five tables and I need to merge these tables column wise, each table will have to same amount of records but might have different amount of columns. So I need the first record form table1 and table2 and table3 and table4 and table5 to be in record 1 in my merged array or table. Second record form table1 and...
35
3015
by: Frederick Gotham | last post by:
(Before I begin, please don't suggest to me to use "std::vector" rather than actual arrays.) I understand that an object can have resources (e.g. dynamically allocated memory), and so we have to copy an object properly via copy- construction rather than using memcpy. However, is it okay to move an object manually (i.e. by using memcpy or memmove)?
33
2309
by: Frederick Gotham | last post by:
(My dialect of English seems to puzzle people at times, so I'll first clarify a few terms which I use in the following post:) (1) By "domestic", I mean "ordinary, run-of-the-mill, not extraordinary or strange". (2) By "willy-nilly", I mean something along the lines of "haphazardly", but without any sense of recklessness (i.e. gleefully doing something without expecting any sort of negative effect, even though there may in fact be a...
3
1881
by: Eric | last post by:
When i run my query it transfer last 4 digits of account number from one table to another and its wrong. There are two tables one i use for parsing. Second thru query i use to move data from temp table to actual table with some little changes in temp table. I use the same code in two different databases One database works fine and another database wont move the account number with 9 digit size. Difference is only the structre of text files...
5
7958
by: David | last post by:
Is there an effecient way to move an array entry up or down in the array? For example. Say you have an array of 5 entries. They are all strings by the way. myArray = ("entry0","entry1","entry2","entry3","entry4"); What is needed is a mechanism/function to move any of the array entries up or down in the array. I have been trying by first splice(selectedEntry) out of the Array, then a couple of slice() and then concat() them all back
12
4410
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql table. Then read the second line in text file and repeat. Thanks for your time Ian
3
5449
by: jaeden99 | last post by:
I was wandering if nyone has a script to move files older than x days old? i've seen several to delete, but I don't want to delete. I would like to create a backup of the files first verify with users if it's ok to delete. Thanks in advance. i found one that was really close but it only looks at one folder. I need it to look at files within folders and subfolders too. Dim oFSO, wshShell, FileCol, oFolder, objTextFile, shareLength,...
0
8399
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
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 we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.