I created one web setup project. when i install website it will automatically create database on local machine and server. its work on local machine but i don't know how to create database on server with .bak file. i think its need to .bak file in \backup\
folder on server.
The queston is, what does not work? What errors or exceptions do you see? Is the database SqlServer? Are you able to execute scripts on the remote database?
i am getting this error "System.Data.SqlClient.SqlError: Cannot open backup device 'D:\\Backup\\EFMVC.bak'. Operating system error 3(The system cannot find the path specified.)." when i restore .bak file on remote server. any idea how to resolve this issue.
chirag.mca87
Member
13 Points
30 Posts
how to create database in remote server using c#
Sep 25, 2012 11:07 AM|LINK
Hello Friends,
I created one web setup project. when i install website it will automatically create database on local machine and server. its work on local machine but i don't know how to create database on server with .bak file. i think its need to .bak file in \backup\ folder on server.
if anyone know than pls reply me
Thanks In Advance.
~Regards
Chirag Adalja
SohailShaikh
Contributor
6109 Points
1167 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 11:17 AM|LINK
Check this link
http://forums.asp.net/t/1823727.aspx/1
Sohail Shaikh
chirag.mca87
Member
13 Points
30 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 12:15 PM|LINK
Thnks Sohail for ur interest.
but i need to use .bak file and restore on remote server i tried like that but its only wotk for local machine not for remote server.
RichardY
Star
8376 Points
1573 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 12:23 PM|LINK
The queston is, what does not work? What errors or exceptions do you see? Is the database SqlServer? Are you able to execute scripts on the remote database?
chirag.mca87
Member
13 Points
30 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 12:30 PM|LINK
thnks Richard For ur interest
i am getting this error "System.Data.SqlClient.SqlError: Cannot open backup device 'D:\\Backup\\EFMVC.bak'. Operating system error 3(The system cannot find the path specified.)." when i restore .bak file on remote server. any idea how to resolve this issue.
Bansal Nitin
Member
14 Points
28 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 12:58 PM|LINK
http://stackoverflow.com/questions/3052335/how-to-connect-to-remote-sql-server-database-using-visual-c
Hope this helps .............
RichardY
Star
8376 Points
1573 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 01:58 PM|LINK
Is the code you are using runing on the remote server or are you attempting to connect to the remote server from a local machine?
It might help us understand if you post the code you are using.
SohailShaikh
Contributor
6109 Points
1167 Posts
Re: how to create database in remote server using c#
Sep 25, 2012 07:33 PM|LINK
Check these link here the author also perform your task please see this link may be its help ful to you
http://www.mindfiresolutions.com/How-to-Restore-SQL-Backup-file-through-NET-Code-480.php
http://www.dotnetobject.com/expage.php?exurl=http://www.dotnetfunda.com/articles/article489-backup-and-restore-database-in-aspnet-.aspx
Sohail Shaikh
chirag.mca87
Member
13 Points
30 Posts
Re: how to create database in remote server using c#
Sep 26, 2012 05:55 AM|LINK
Thanks Rechard
i am attempting to connect remot server from local machine.
once again thnks
akkemraju
Member
2 Points
20 Posts
Re: how to create database in remote server using c#
Feb 02, 2013 10:18 AM|LINK
Hi,
Which remote server you are using?
Thank you.