Solved

How to save the Dataset to a new file using today's Date as filename?

Posted on 2004-10-14
6
162 Views
Last Modified: 2010-04-23
Hi,

I am using Provider=Microsoft.Jet.OLEDB.4.0 connection to load and save my database to file.

I have created datatable in a dataset. and I would like to save this datatable/dataset to a new file created using todays date as the filename.

e.g. checks if the file exist, then otherwise create a new file called "14-07-2004.mdb"

I guess the checking if the file exist is easy, but I don't how to create new file in ADO.net and using the date as a filename.

Any help would be appreciate!

many many thanks.
0
Comment
Question by:staines
6 Comments
 
LVL 10

Expert Comment

by:Hans Langer
ID: 12314150
Hi !
You want to create a file from de dataset ?, with what format ?
0
 
LVL 9

Expert Comment

by:checoo
ID: 12316230
if you want to save it as XML then its easy

datset.getXML(filename)
0
 

Author Comment

by:staines
ID: 12317244
I mention as above, i want to create a database file using the data as "15-10-2004.mdb"

a .mdb file...

thanks.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12317788
Hi staines,

look here for a
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 250 total points
ID: 12317792
0
 
LVL 10

Expert Comment

by:Hans Langer
ID: 12318253
nice article.

now, just change:

 cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=D:\AccessDB\NewMDB.mdb;" & _
                 "Jet OLEDB:Engine Type=5")

to

 cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=D:\AccessDB\"  & Now.Date.ToString("dd-MM-yyyy") & ".mdb;" & _
                 "Jet OLEDB:Engine Type=5")
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sql server insert 13 46
vb.net and creating a class 5 29
Help with error in Query 2 38
Error message when using PrintSocket.Send 7 26
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question