hello,
i am new to c#.net.
i have imported data in datagridview form ms access database.
now i want to store each row of datagridview saperatly in string array
so in saperate class i have created string array named dirurl
my code is as follows
IN CLASS1
code:
public static string[] dirurl = new string[100];
and in my form i want to get as follows ::
int tin = dataGridView1.RowCount;
for (int j=0; j <= tin; j++)
{
Class1.dirurl[j] = dataGridView1.Rows[j].Cells[1].Value.ToString();
}
but when program goes to execute for loop it gives me following error:
Object reference not set to an instance of an object.
please help me to get data in dirurl array...