all groups > dotnet general > july 2004 >
You're in the

dotnet general

group:

Multiple entries in DataTable



Multiple entries in DataTable Job Lot
7/7/2004 10:27:01 PM
dotnet general: I have tow columns in my DataTable Date, Amount. What would be the best way to create multiple entries in my DataTable? I am given a start date, end date and an amount. I want to create multiple entries for the given amount starting from start date until end date. For instance

Start Date is 01/01/2003
End Date is 01/01/2017
Amount is $50

I want to create entries as follow:

01/01/2003 $50
01/02/2003 $50
01/03/2003 $50
01/04/2003 $50
…
…
…
01/01/2017 $50

Thanks
Re: Multiple entries in DataTable Teemu Keiski
7/8/2004 2:02:42 PM
Hi,

if you do it all programmatically and not via database, you either create it
row by row or by using LoadDataRow method. If you put lotd of row into
DataTable, LoadDataRow is good choice as it performs better especially if
you load more rows in once..

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatadatatableclassloaddatarowtopic.asp

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke




[quoted text, click to view]
way to create multiple entries in my DataTable? I am given a start date, end
date and an amount. I want to create multiple entries for the given amount
starting from start date until end date. For instance
[quoted text, click to view]

AddThis Social Bookmark Button