Merging Data Tables in C#

by pencilvac 3/9/2012 12:16:00 PM

Merging data tables in C# is incredibly easy. If you have two tables of data pulled from the database:

In this situation our two tables have the same columns.

using System.Data; //include in your code behind so you can use data tables.

 

DataTable dt = Contract.GetDealContracts(pCompanyID, -1,42);

DataTable dt2 = Contract.GetDealContracts(pCompanyID, -1, 40);

 

 

You can then merge the two tables into one by simply:

dt.Merge(dt2); // table1.Merge(table2);

 

BOOM- two tables, now one table, with all your data. 

Tags: , , ,

.NET | ASP.NET Enterprise Library

ASP.NET Ticker Control

by rBellantoni 10/5/2009 12:10:00 PM

This site has a nice ticker control:

 http://www.devdude.com/tools/js/vertical_ticker/

Tags: , , ,

Setting Session Timeouts in ASP Classic and ASP.NET

by ebarcza 8/21/2009 5:45:00 AM

First the Classic

I set this in my login script or alternativwly can be set in the Global.asa in the Session_OnStart Event 

Session.Timeout = 120 -- 120 being the number of minutes.

sub Session_OnStart

'120 minutes

Session.Timeout = 120

end sub

Now ASP.NET

Via Web Config

<sessionState timeout="60" />

Tags: , ,

.NET

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  September 2017  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in