Copy database from server
i install new window and i forget take a copy of my database file but i uploaded my database erst.how can i copy my database from server to my computer.with export only copy tables and views ,but i need my stored procedures too. how can i return my database completely?

Kirtan PatelRank #292 · 8.6K reputationPosted Nov 17, 2009, 3:23 AM EST
you ca define Username Password etc Like Below set connection Properties . :)
ServerConnection conn = new ServerConnection("rune\\sql2008");
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 16, 2009, 2:51 AM EST
Which Database you are Using SQL Server or Local Access/SQL Server mdf file ??? database if you are using Database Which is on SQL Server then
here is Code that iis Using
please check "do you like this answer check box" :)
//First Reference the assembly microsoft.sqlserver.smo.dll
//Then Import SMO by Following Line
using Microsoft.SqlServer.Management.Smo
//------------------------------------------------
//Code Like Below then
ServerConnection conn = new ServerConnection("rune\\sql2008"); Server server = new Server(conn); Database newdb = new Database(server, "new database"); newdb.Create(); Transfer transfer = new Transfer(server.Databases["source database"]); transfer.CopyAllObjects = true; transfer.CopyAllUsers = true; transfer.Options.WithDependencies = true; transfer.DestinationDatabase = newdb.Name; transfer.DestinationServer = server.Name; transfer.DestinationLoginSecure = true; transfer.CopySchema = true; transfer.CopyData = true; transfer.Options.ContinueScriptingOnError = true; transfer.TransferData();bahare g68 reputationPosted Nov 16, 2009, 9:48 PM EST
is rune\\sql2008 address of local database or uploaded database?what i write instead of rune\\sql2008?i use sql2005.
ServerConnection conn = new ServerConnection("rune\\sql2008");
and my uploaded database have user and password,then where can i write address,user and password of my uploaded database to transfer information from it?
bahare g68 reputationPosted Nov 17, 2009, 7:43 PM EST
user,pass,and database name are right.but i do not why it have problem.
ServerConnection conn = new ServerConnection(new SqlConnection("Data Source=server name;Initial Catalog=mydatabase name;User ID=myuser;Password=****;"));