473,320 Members | 2,052 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,320 software developers and data experts.

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 9275
Peter,
Basically you need to keep doing DataTable.NewRow, so I don't think there is
an alternative. e.g. (pseudocode):

DataRow row;
foreach(item in myArray)
{
row=MyTable.NewRow();
row.ItemArray= item // assuming they match the columns, or whatever
MyTable.Rows.Add(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.microsoft.comwrote in message
news:Ek**************@TK2MSFTNGXA01.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.microsoft.comwrote in message
news:aR**************@TK2MSFTNGXA01.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.com, 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 DataGridTextBoxColumn.Format and
FormatInfo properties.

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

To demonstrate my statement, I have modified that project regarding the
guide I provided. In the sample project, I set
DataGridTextBoxColumn.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.microsoft.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.microsoft.comwrote in message
news:yf**************@TK2MSFTNGXA01.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
Hi Peter,

Thanks for your feedback!

I have sent an email to you with the attachment. Please check it in your
mailbox and feedback any comment here. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 18 '06 #11

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

Similar topics

17
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...
2
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...
14
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...
35
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...
33
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...
3
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...
5
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 =...
12
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.