TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Angel Princess
NA
100
47.1k
How to replace existing ms access database with c# code?
Aug 24 2015 7:11 AM
String baseDirectory = @"F:\Backup";
String mdbSourceFilePath = @"D:\Db\abc.mdb";
String mdbTargetFileName = "abc.mdb";
String fullDirectory = Path.Combine(baseDirectory, DateTime.Today.ToString("dddd"));
if (!Directory.Exists(baseDirectory))
Directory.CreateDirectory(baseDirectory);
if (!Directory.Exists(fullDirectory))
Directory.CreateDirectory(fullDirectory);
String mdbTargetFilePath = Path.Combine(fullDirectory, mdbTargetFileName);
File.Copy(mdbSourceFilePath, mdbTargetFilePath);
This is for backup of database. If I click on backup button this is creating backup database but if I click it again is is not overwriting existing database. I want to replace the existing database.
Reply
Answers (
1
)
what is the use of DirectoryEntry control?
how to do allow only phone number validation max 10