473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Multiple entries in DataTable

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
1 1324
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joe | last post by:
Hey, I'm going to give some background on my situation in case anyone can point out a way around my problem altogether... for the problem itself, please skip to the bottom of the post. thanks....
1
by: frank | last post by:
I have two DataTables, A and B. Both have the primary key "CID". How do I remove all entries in Table A from Table B (with the same PK)?
1
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
5
by: Sammy | last post by:
On a Windows 2003 Server machine that has multiple IIS web sites, how does one control which web site the new web application gets created under? Thank you, Sammy
5
by: Ron L | last post by:
I have a DataTable that is being maintained in a Model class. I also have a View class which creates a DataView from the DataTable that the Model passes it. The view class then has methods to...
1
by: Job Lot | last post by:
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...
1
by: Rico | last post by:
I have tried to access a database using asp.net. after some entries like 120+, I got an unspecified error message. Anyone know what is happening, it seems to be stuck at the same line even when i...
3
by: Bernard Lebel | last post by:
Hello, Is there an option or a way to allow the selection of multiple entries in the Listbox widget? I could not find any, and would like to allow the end user to select multiple entries. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.