Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello,
I have created a project in C# GUI and database i used is SQL SERVER 2000, i have cretaed a database named "maso" and it contains around 7 tables and in some tables i am inserting data by opening the IDE of SQL SERVER 2000 now what i want is that during the set up i.e when my project is being installed at the clients computer i want the maso database to be installed at the same time not only this maso contains an admin table in which i am inserting data by writing the following piece of sql code:

insert into admin values('radix',123);

this query must also be executed at the same time is this possible please help me out

Thank You;
Radix
Posted

I don't know what you are trying to do.
Why are you installing SQL Server on the client?
There must be a dedicated database server (at least), so that every client can connect to a common database.
Do you have only ONE client?
If this is the case, there are many option for storing data.
If you want to use SQL Server only, you include a SQL Server CE Database file. Create tables and save the data into the database before doing a release build.

Hope this helps!
 
Share this answer
 
Using Sql Manager Express (free util from MS), export your database to a script, and then...

0) Embed the script as a resource in an appropriate assembly.

1) When your program starts up, try to connect to the database.

2) If it's not there (the SqlConnection.Open() method throws an appropriate exception), have your program extract and run the script to create it. Then, delete the script file from th disc.

3) Retry the connection
 
Share this answer
 
v3
Perhaps you could create an SQL Server Compact Edition database to ship with your product? You can create it from scratch using a bunch of queries either at installation or in advance, or you could use a third party tool to create a CE database from your server based database.
 
Share this answer
 

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