• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

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

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
staines
Asked:
staines
1 Solution
 
Hans LangerCommented:
Hi !
You want to create a file from de dataset ?, with what format ?
0
 
checooCommented:
if you want to save it as XML then its easy

datset.getXML(filename)
0
 
stainesAuthor Commented:
I mention as above, i want to create a database file using the data as "15-10-2004.mdb"

a .mdb file...

thanks.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
RonaldBiemansCommented:
Hi staines,

look here for a
0
 
RonaldBiemansCommented:
0
 
Hans LangerCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now