Click here to Skip to main content
12,293,601 members (59,794 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# SQL-Server

i wanna program a code which is can be a simple example of SQL SERVER 2008 backup/restore in c# which data base not using password and username in its connection string ... i search many projects in google but none of couldn't help me to can make a simple project for backup and restore database sql server... please kindly show me any good complete code which i can create a simple project for my understanding which this program simply run .... many thanks

its back up works right but for restor failed for connect to server ?

        <add name="Alioglu.Util.SqlSrv.BackupRestore.Properties.Settings.masterConnectionString">
            connectionString="Data Source=PERSIAN-PC\SQLEXPRESS;Initial catalog=master;Integrated Security=True;User Instance=True"
            providerName="System.Data.SqlClient" />
Posted 18-Jan-13 1:25am
Edited 18-Jan-13 2:46am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If your server is set up for windows authentication and your C# program runs under an authenticated account, you do not need to give credentials. If not, then there's no way.
rflower 18-Jan-13 8:44am
yes it has set but what i have written why not working in xml for its connection string ... it works right for BACKUP but it given this error for RESTORE Part "Restore Failed for server PERSIAN-PC\SQL-EXPRESS " ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100