?
Solved

GridView bind a 2d array

Posted on 2008-06-16
2
Medium Priority
?
1,084 Views
Last Modified: 2013-11-26
Hi,

I have a 2 dimensional array ...

Dim arr(50, 3) as string

I have put the data into this array, but now i want to put the data from the array into a gridview.  Has anyone got the code to do this?

Thanks,

Darryl
0
Comment
Question by:yo_daz_uk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
zveljkovic earned 400 total points
ID: 21792358
Hi. here is some sample code for you.
			DataTable t = new DataTable("name");
//add coresponding number of columns or just go in for loop
			t.Columns.Add("col1");
			t.Columns.Add("col2");
			t.Columns.Add("col3");
			t.Columns.Add("col4");
//add new row 
			t.Rows.Add( new String[] {"asdf","qwer","ertt","rtyerty"});
			t.Rows.Add( new String[]  {"asdf","qwer","ertt","rtyerty"});
//databind
			this.dataGridView1.DataSource = t;

Open in new window

0
 

Author Closing Comment

by:yo_daz_uk
ID: 31467540
i used similar code to the above to achieve this
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question