Click here to Skip to main content
15,913,280 members
Home / Discussions / C#
   

C#

 
AnswerRe: Binding data to Listview Pin
Sathesh Sakthivel12-Jul-07 18:44
Sathesh Sakthivel12-Jul-07 18:44 
GeneralRe: Binding data to Listview Pin
T.EDY12-Jul-07 19:58
T.EDY12-Jul-07 19:58 
AnswerRe: Binding data to Listview Pin
RepliCrux12-Jul-07 19:00
RepliCrux12-Jul-07 19:00 
QuestionSynchronize SQL and Access in .NET 2005 Pin
Elizma12-Jul-07 18:11
Elizma12-Jul-07 18:11 
AnswerRe: Synchronize SQL and Access in .NET 2005 Pin
Paul Conrad12-Jul-07 18:21
professionalPaul Conrad12-Jul-07 18:21 
GeneralRe: Synchronize SQL and Access in .NET 2005 Pin
Elizma12-Jul-07 18:27
Elizma12-Jul-07 18:27 
GeneralRe: Synchronize SQL and Access in .NET 2005 Pin
Paul Conrad12-Jul-07 18:47
professionalPaul Conrad12-Jul-07 18:47 
QuestionQuick way to add 1D array to Multidimensional array Pin
RYU^^12-Jul-07 17:30
RYU^^12-Jul-07 17:30 
Hi,

I am trying to find a quick way to add 1 dimensional array into multidimensional array. For example:
<br />
object[] oneDArray1 = new object[10];<br />
object[] oneDArray2 = new object[10];<br />
object[] oneDArray3 = new object[10];<br />


Then, I need to add this array into 2D Multidimensional array.
<br />
object[,] twoDArray = new object[3, 10];<br />


The reason I need to do this is because I have a DataSet and I need to convert this DataSet to Excel Application.
Currently, I do the following:
<br />
oRng.Value2 = oDataTable.Rows[iRowIdx].ItemArray<br />


This code work if the Range is within single row. Now, if I have 1000 rows, this is process is very slow. It takes about 20 seconds to loop through the range and set the rows.

Alternatively, I could set the value of the range at one go. For example I want to set the value from Row #1 Column #1 to Row #1000 Column #1000, I must do
<br />
object[,] 2DMultiDimensionalArray = new object[1000, 1000];<br />
oRng = oSheet.get_Range("A1", "ALL1000");<br />
oRng.Value2 = 2DMultiDimensionalArray;<br />


In order to set the excel value at one go, I MUST convert each DataRow.ItemArray into MultiDimensional array. I need to add Single Dimensional Array into MultiDimensional array (NOT jagged array because I have try it and it throw an error).
An unhandled exception of type 'System.Runtime.InteropServices.SafeArrayTypeMismatchException' occurred in mscorlib.dll

Additional information: Specified array was not of the expected type.

Any help is greatly appreciated!

Thanks Smile | :)
AnswerRe: Quick way to add 1D array to Multidimensional array Pin
Elizma12-Jul-07 18:07
Elizma12-Jul-07 18:07 
GeneralRe: Quick way to add 1D array to Multidimensional array Pin
RYU^^12-Jul-07 21:45
RYU^^12-Jul-07 21:45 
AnswerRe: Quick way to add 1D array to Multidimensional array Pin
Sathesh Sakthivel12-Jul-07 18:09
Sathesh Sakthivel12-Jul-07 18:09 
GeneralRe: Quick way to add 1D array to Multidimensional array Pin
RYU^^12-Jul-07 21:46
RYU^^12-Jul-07 21:46 
GeneralRe: Quick way to add 1D array to Multidimensional array Pin
J4amieC12-Jul-07 23:57
J4amieC12-Jul-07 23:57 
QuestionWindows Media Player 11 Repeat??? Pin
Small Rat12-Jul-07 11:50
Small Rat12-Jul-07 11:50 
Questionreading data from serial port and graph it Pin
ahmad al-omar12-Jul-07 9:35
ahmad al-omar12-Jul-07 9:35 
AnswerRe: reading data from serial port and graph it Pin
PhilDanger12-Jul-07 10:23
PhilDanger12-Jul-07 10:23 
GeneralRe: reading data from serial port and graph it Pin
ahmad al-omar13-Jul-07 10:01
ahmad al-omar13-Jul-07 10:01 
AnswerRe: reading data from serial port and graph it Pin
Ed.Poore12-Jul-07 12:02
Ed.Poore12-Jul-07 12:02 
GeneralRe: reading data from serial port and graph it Pin
ahmad al-omar13-Jul-07 10:05
ahmad al-omar13-Jul-07 10:05 
GeneralRe: reading data from serial port and graph it Pin
Ed.Poore13-Jul-07 12:09
Ed.Poore13-Jul-07 12:09 
QuestionRemoting problem Pin
Wjousts12-Jul-07 9:30
Wjousts12-Jul-07 9:30 
AnswerRe: Remoting problem Pin
Larantz12-Jul-07 11:46
Larantz12-Jul-07 11:46 
GeneralRe: Remoting problem Pin
Wjousts13-Jul-07 2:05
Wjousts13-Jul-07 2:05 
GeneralRe: Remoting problem Pin
Larantz13-Jul-07 23:05
Larantz13-Jul-07 23:05 
Question.Net 3 Pin
mehrdadc4812-Jul-07 9:24
mehrdadc4812-Jul-07 9:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.