I am taking the data into a 2d string in C#. Defined as ::
string[,] strValueBasic = new string[GridView1.Rows.Count,49];
Now i want the data to be taken into DataRows and add these rows into the DataTable.
for (int i = 0; i < GridView1.Rows.Count; i++)
{
DataRow drRow = dtNew.NewRow();
drRow.ItemArray = strValueBasic[i];
dtNew.Rows.Add(drRow);
}
But i am not able to access this 2d String array in the step
drRow.ItemArray = strValueBasic[i];
It is giving error as Wrong number of indices inside [], expected 2.
I know that it requires 2 indices, but than i want the whole row of that string array to be filled inside that DataRow.
Also the structure of DataRow and String Array is same.