Wednesday, August 11, 2010

I have 10 datagrid views in a form i want to write a loop for it in c#.net.How do i wirte the code.?

I have written in this way


for(i=0;i%26lt;10;i++)


{


(datagridview+i).DataSource=DataSet;


(datagridView+i).Datamember=DatsSet.Ta鈥?br>

}


But for this iam getting a error .








Pls tell me how to write the code for the following.I have 10 datagrid views in a form i want to write a loop for it in c#.net.How do i wirte the code.?
for(i=0;i%26lt;10;i++)


{


(datagridview + i +).DataSource=Da...


(datagridView + i+ ).Datamember=Da...


}


The problem was taht the gridview is required to be appended.Hope this will work.And if the value of i is appened to the datasourse the way it was before will give error as the compiler does not know that it is the variable.So we require to append it the i have descrided

No comments:

Post a Comment