Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i try make project in C# when Project Start auto create DataBase and save Tables in database and save same Query in DataBase

What I have tried:

but i don't know how to save query in access database, i use database access 2007
Posted
Updated 2-Oct-20 1:09am

1 solution

Basically, don't.

The last thing you want to do is create tables every time you run your app: it could be run a hundred times in a day, and if you create new tables each time then whatever dta you saved previously will be discarded.

A database is a type of non-volatile or persistent storage: it is intended that the changes you make on this run of the application are available the next time you run it, and / or that changes other users make to the DB are visible to all users including you.

Start here: C# MS Access Database Tutorial – eWorker Courses[^] - you need to get the basics sorted out before you start even thinking of writing code!
 
Share this answer
 
Comments
Amar chand123 2-Oct-20 7:18am    
My database create if not exist in Folder but problem i have i need writing full code like "Select form table1.columns1... table2.Columns1.... inner join "
I want create a query in database and save like i save in query design in access database
OriginalGriff 2-Oct-20 7:53am    
What you are looking at is a Stored Procedure, but Access 2007 doesn't support them - they were not added until Access 2010.

You can't do what you want to.
Amar chand123 2-Oct-20 8:24am    
Sir Than any other database suggestion
OriginalGriff 2-Oct-20 8:46am    
Access 2010?
SQL Server?
MySql?

I have no idea what is available to you!

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