PC Review


Reply
Thread Tools Rate Thread

Code to Invert a Datagrid

 
 
intractably@gmail.com
Guest
Posts: n/a
 
      15th Jul 2006
Hope this helps...

public void InvertDS(ref DataSet ds)
{
try
{
DataSet ds2 = new DataSet();
ds2.Tables.Add();
ds2.Tables[0].Columns.Add();
ds2.Tables[0].Columns.Add();

for(int i=0; i < ds.Tables[0].Columns.Count; i++)
{
object [] array = new object[2];
array[0] = ds.Tables[0].Columns[i].ColumnName;
array[1] = ds.Tables[0].Rows[0][i];
ds2.Tables[0].Rows.Add(array);
}

ds = ds2;
}
catch(Exception ex)
{
string s = ex.ToString();
}
}

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid from Code Shapper Microsoft ASP .NET 0 22nd Jun 2005 01:29 PM
DataGrid and rtf code =?Utf-8?B?cmtibmFpcg==?= Microsoft ASP .NET 2 31st Jan 2005 09:09 PM
DataGrid transpose/invert =?Utf-8?B?QXNo?= Microsoft Dot NET Framework 1 2nd Aug 2004 06:29 AM
DataGrid transpose/invert =?Utf-8?B?QXNo?= Microsoft Dot NET Framework Forms 0 8th Jul 2004 12:47 PM
Last Name First Name Invert David Kennedy Microsoft Access Getting Started 1 25th Jun 2004 12:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:05 PM.