How do you bind array to gridview? Will it works?

Answer Posted / uma

all the answers are correct, but its not write way to store
array to grid,if u insert data into grid view as the above
mension answers expect first one answer, the data will be
diaplayed in column wise, actually the data in grid view is
displayed in rowwise, so we convert array data into a
spesfic datasource like lists,generic list etc;


int32[] arr=new int32[10];
arr[1]=2;
arr[2]=3;

list<> lt=new list<arr>
lt.add(arr[1]);
lt.add(arr[2]);
GridView1.DataSource = lt;
GridView1.DataBind();

Is This Answer Correct ?    9 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the server of asp.net?

506


What are the steps to follow to host a web application on a web server?

591


How to display validation messages in one control?

548


Is LINQ performance wise better or using sqlcommand?

4335


What is postback request?

554






What is application variable in asp.net?

465


How to manage different kinds of sessions in ASP.NET?

563


What is the difference between mechine.config and web.config?

734


Explain ViewState?

578


What is bson in web api?

590


What is comparevalidator?

523


What is difference between mvc and asp.net? : Asp.Net MVC

570


Are there resources online with tips on asp to asp.net conversions?

548


When cookie will expire?

582


In which event are the controls fully loaded?

568