Multiple entries in DataTable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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




Job Lot said:
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
 
Back
Top