Click here to Skip to main content
15,910,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Create Database Using C#

Hi,

I write software in C# that should create (by itself) a new database.
The SQL server should be installed on the customer's computers silently
(I still need to figure how to do this part)
How can my software create a database that only it can access? Do I
need to create a special user account from the software?
What user account do I use to open a connection to the SQL server in
the first place when I create the database (taking under consideration
that the SQL server was installed silently and as far as the user
concern he has no idea my software uses SQL server).

To summarize:
1.The install of my software should install and configure the SQL
server silently (appreciate any help here)
2.The software needs to access the local SQL server and create a
database that only it can access when the software runs
Posted

You should not install SQL server on the customer computer: the only version you could install is the Express version - all the others need to be paid for - and they may have it installed already on another server. Instead, ask your user, and point him at where to get the express version if he doesn't have it yet.
 
Share this answer
 
This is illegal.You are not authorized to install another Microsoft product with your program.

Install sql server database with visual studio setup
 
Share this answer
 
Comments
amsainju 5-Jun-11 14:25pm    
hey i visited
http://msdn.microsoft.com/en-us/library/49b92ztk%28v=VS.90%29.aspx#Y1075
for my solution i did as stated in the page with little modification in the code to manange the problem that occur with different version of .net framework...
at the end the whole code didn't show any error but when i executed the output the following error occured in the middle of the execution
Error 1001.Object reference not set to an instance of an object

if you like to see the code i did i can send you in your email...
Monjurul Habib 21-Jul-11 17:32pm    
sounds great..thumbs up.
I think you should try XML databse system.
 
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