Creating a DATABASE programmatically
i creating database following code
myconn = new sqlconnection("data source=.\\sqlexpress;attachdbfilename=c:\\users\\nishant\\desktop\\systemdatabase\\systemdatabase\\app_data\\database1.mdf;integrated security=true;user instance=true");
sqlcommand cmd = new sqlcommand();
cmd.connection = myconn;
cmd.commandtext = "create database "+textbox1.text;
myconn.open();
cmd.executenonquery();
myconn.close();
nalin taneja
hi nilin,
based on description, mean want create database programmatically?
if so, can refer folowing links:
http://www.codeproject.com/kb/tips/createsqldv.aspx
http://support.microsoft.com/kb/307283
http://support.microsoft.com/kb/305079
vin jin [msft]
msdn community support | feedback us
get or request code sample microsoft
please remember mark replies answers if , unmark them if provide no help.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment