Click here to Skip to main content
15,924,901 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,

I have to create database and run sql script by the user defined credential e.g.
(server name,database name, authentication mode, userid, password) in asp.net using C#.

Please let me know how to implement it.

Thanking You
Mohd Wasif
Posted
Comments
OriginalGriff 10-Mar-11 2:16am    
Have you tried anything yourself?

nice question I use the following approach for this--

1- this is for sqlserver
2- create connection with master database(as it is default in sqlserver)
3- now use query
Create database yourdbname

4- now run your script
using yourdatabasenamw
your script


--Pankaj
 
Share this answer
 
<a href="http://www.codeproject.com/KB/aspnet/SQLDb_Using_Aspnet.aspx">Create SQL Server Database using asp.net</a>[<a href="http://www.codeproject.com/KB/aspnet/SQLDb_Using_Aspnet.aspx" target="_blank" title="New Window">^</a>]
 
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