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

Tell me the code snippet to show how we can return 404 errors from HttpError?

792


What’s the difference between asp.net web forms and asp.net mvc?

553


What is the viewstate in asp.net?

576


Mention the execution process for managed code?

539


if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.

1842






Explain how cookies work. Give an example of cookie abuse.

721


What is the difference between table and query?

548


Name the namespace which is used by ado.net?

532


Explain the difference between Web Garden and Web Farm?

551


Describe briefly what is the role of IIS on an ASP.NET application? What does it for the same application?

566


Explain the use of resource manager class in .net.

508


Is asp.net and .net are same or different?

530


What is an example of an application service provider?

457


Differentiate between a hyperlink control and a linkbutton control.

560


What is the benefit of WebAPI over WCF?

573