By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,231 Members | 1,747 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,231 IT Pros & Developers. It's quick & easy.

Multiple entries in DataTable

P: n/a
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

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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...tarowtopic.asp

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


"Job Lot" <Job Lo*@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
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

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.