Dataview copy throws errror
I have 2 dataview and i want to add some rows of Dataview2 to Dataview1.
here is my code,
Dataview Dataview1 = new Dataview();
for(i=0;i<5;i++){
Dataview1.Table.Rows.Add(Dataview2.Table.Rows[i]);
}
But in the for loop duing the row add, it shows me some Type casting error like 'Object reference not set to an instance of an object.'.
Can someone please help me out to resolve this issue?
Thanks!