Click here to Skip to main content
15,919,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello;

In executing all SQL commands(like SELECT, INSERT, CREATE TABLE ,...) at runtime,there should be two objects set properly. One (for Access databases)is OleDbConnection, which gets connected to desireed database through its ConnectionString property. The second one is OleDbCommand where the needed SQL commands is stored. So there should be a database on which the command is performed. My problem is I want to make database at runtime so there is no database before to attach to by OleDbConnection. Although I know SQL comand for creating database, not knowing where OleDbConnection should get connected to (due to not having prevoius database), I do not know what to do. Could you please help me?

Thank you very much
Posted
Comments
Rajesh Sajjanar 2-Aug-10 3:43am    
HiWhy you need to create database at runtime, is it each time you run application wanted to create database ??

1 solution

The best way to handle this IMO, is to put a blank DB in with your project and make a copy when you want to create a new database.
 
Share this answer
 
Comments
ahhashemi 3-Aug-10 21:47pm    
Reason for my vote of 4
A Simple useful clue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900