How do you bind array to gridview? Will it works?
Answers were Sorted based on User's Feedback
int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8 };
GridView1.DataSource = arr;
GridView1.DataBind();
try this.
Is This Answer Correct ? | 24 Yes | 5 No |
Answer / 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 |
Answer / mallu
Dim i As Integer
Dim fib(10) As Integer
fib(0) = 1
fib(1) = 1
For i = 2 To 10
fib(i) = fib(i - 1) + fib(i - 2)
Next
Me.grdResults.DataSource = fib
Me.grdResults.DataBind()
Is This Answer Correct ? | 5 Yes | 7 No |
Answer / alpesh
get the values in to the array
now pull that array values in one Dataset haveing same
array structure
now assign that dataset to the grid view
thats it
Is This Answer Correct ? | 7 Yes | 10 No |
What is difference b/w Generic List and Arraylist, Generic List Vs HashTable, Generic List Vs No Generic? Pls Explain with example.
Difference between web.config and app.config?
3 Answers ITC Infotech, Jenesys Technologies,
What does postback mean?
Is asp.net a programming language?
What is the difference between ASP.NET Webforms and ASP.NET MVC?
Explain exception handling in .net.
Explain one critical mapping?
Where would you use an iHTTPModule, and what are the limitations of any approach you might take in implementing one?
Explain what is postback in asp. Net?
what is webservices. howit is use in our project .
how many script manager controls are used in Ajax web page?
7 Answers CSC, Health Prime Services, TCS,
Explain weak typing and strong typing.