Solved

GridView bind a 2d array

Posted on 2008-06-16
2
1,070 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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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