September 4, 2006 at 4:01 am
Hi,
I wrote a c# application which uses sql server 2005. I finished it and now i want to run the
application with the same DataBase on another computer.
Is there any way to create the DataBase automaticlly on the destination computer befrore i run the application on it? perhaps by running XML file on the computer?
Thanks In Advance
September 4, 2006 at 5:38 am
What about using the script database function in sql server management studio? Right click the DB, script database as, create
September 4, 2006 at 6:02 am
Could you please describe in more detailed way what I should do?
After I create this script file, I just need to run it on the destination computer?
Thanks
September 4, 2006 at 11:02 pm
hi,
You just run the sql script in Application_Beginrequest event in Global.asax to create database for you.
September 7, 2006 at 11:59 pm
You can also use the ServerConnection class in SMO to execute arbitrary scripts from code (even if they have GO keywords in them).
Check out the ServerConnection.ExecuteNonQuery() and similar methods.
ServerConnection class is described here: http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.management.common.serverconnection.aspx
---------------------------------------
elsasoft.org
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply