Click here to Skip to main content
16,005,206 members
Home / Discussions / Database
   

Database

 
GeneralRe: INSERT INTO sql Pin
pmarfleet25-Sep-07 0:52
pmarfleet25-Sep-07 0:52 
AnswerRe: INSERT INTO sql Pin
Pete O'Hanlon25-Sep-07 2:21
mvePete O'Hanlon25-Sep-07 2:21 
Question[Message Deleted] Pin
Hari Om Prakash Sharma24-Sep-07 18:59
Hari Om Prakash Sharma24-Sep-07 18:59 
AnswerRe: from_unixtime() function Pin
pmarfleet24-Sep-07 19:47
pmarfleet24-Sep-07 19:47 
AnswerRe: from_unixtime() function Pin
Pete O'Hanlon25-Sep-07 2:36
mvePete O'Hanlon25-Sep-07 2:36 
QuestionTransfering data problem Pin
Pamela198424-Sep-07 11:06
Pamela198424-Sep-07 11:06 
AnswerRe: Transfering data problem Pin
Paul Conrad3-Nov-07 7:49
professionalPaul Conrad3-Nov-07 7:49 
QuestionBackup SQL Server Pin
Bonsta24-Sep-07 7:01
Bonsta24-Sep-07 7:01 
I want to backup an SQL Database that I already have a connection to. The Solutions Ive found on Code projects creates a new connection but I dnt need to do since I already got connection to Data source, I have dataset of the database on my project..I need help to modify the code below so it does not re-connect but uses current datasource and backs it up...



//class variable which came with solution
private static Server srvSql ;

private void btnConnect_Click(object sender, EventArgs e)<br />
       {<br />
           //// <br />
            <br />
            <br />
            //I alreay hav a connection to the database so dnt need this<br />
<br />
            ServerConnection srvConn = new ServerConnection("juji");<br />
<br />
             // Log in using SQL authentication instead of Windows authentication<br />
             srvConn.LoginSecure = false;<br />
<br />
//already hav a connection<br />
<br />
             srvSql = new Server(srvConn);<br />
             // Loop through the databases list,<br />
             foreach (Database dbServer in srvSql.Databases)<br />
             {<br />
// Adds database to combobox, but I dnt need this part since already have a connection<br />
           //     cmbDatabase.Items.Add(dbServer.Name);<br />
           //  }<br />
          <br />
       }<br />
private void btnCreate_Click(object sender, EventArgs e)<br />
       {<br />
          if (saveBackupDialog.ShowDialog() == DialogResult.OK)<br />
          {<br />
             // Create a new backup operation<br />
             Backup bkpDatabase = new Backup();<br />
             // Set the backup type to a database backup<br />
             bkpDatabase.Action = BackupActionType.Database;<br />
             // Set the database that we want to perform a backup on<br />
<br />
//I already know the name of the database but not sure if typing it out correctly, its kofle<br />
             bkpDatabase.Database = "kofle";<br />
<br />
             // Set the backup device to a file<br />
             BackupDeviceItem bkpDevice = new BackupDeviceItem(saveBackupDialog.FileName, DeviceType.File);<br />
             // Add the backup device to the backup<br />
             bkpDatabase.Devices.Add(bkpDevice);<br />
             // Perform the backup<br />
             //;<br />
          }<br />
       }



Thanks in Advance



Is this chair taken

AnswerRe: Backup SQL Server Pin
Paul Conrad3-Nov-07 7:48
professionalPaul Conrad3-Nov-07 7:48 
QuestionProblem with certificate Pin
DerekFL24-Sep-07 5:27
DerekFL24-Sep-07 5:27 
Questionhelp me with outstanding rental payments Pin
twsted f824-Sep-07 5:17
twsted f824-Sep-07 5:17 
AnswerRe: help me with outstanding rental payments Pin
pmarfleet24-Sep-07 9:45
pmarfleet24-Sep-07 9:45 
QuestionFind Exact match Pin
jebin k24-Sep-07 5:12
jebin k24-Sep-07 5:12 
AnswerRe: Find Exact match Pin
DerekFL24-Sep-07 7:50
DerekFL24-Sep-07 7:50 
QuestionSQL type statements without a connection Pin
Evan St. John24-Sep-07 4:34
Evan St. John24-Sep-07 4:34 
AnswerRe: SQL type statements without a connection Pin
Paddy Boyd24-Sep-07 4:48
Paddy Boyd24-Sep-07 4:48 
GeneralRe: SQL type statements without a connection Pin
Evan St. John24-Sep-07 4:59
Evan St. John24-Sep-07 4:59 
GeneralRe: SQL type statements without a connection Pin
Paddy Boyd24-Sep-07 5:02
Paddy Boyd24-Sep-07 5:02 
AnswerRe: SQL type statements without a connection Pin
Mike Dimmick24-Sep-07 5:08
Mike Dimmick24-Sep-07 5:08 
Questionproblem with create trigger Pin
Mohammed Elkholy24-Sep-07 2:28
Mohammed Elkholy24-Sep-07 2:28 
AnswerRe: problem with create trigger Pin
kubben24-Sep-07 8:07
kubben24-Sep-07 8:07 
GeneralRe: problem with create trigger Pin
Mohammed Elkholy24-Sep-07 9:29
Mohammed Elkholy24-Sep-07 9:29 
GeneralRe: problem with create trigger Pin
kubben24-Sep-07 10:49
kubben24-Sep-07 10:49 
AnswerRe: problem with create trigger Pin
joemonvarghese24-Sep-07 20:31
joemonvarghese24-Sep-07 20:31 
QuestionDifference between Delete and Truncate? Pin
ganeshMohan23-Sep-07 20:43
ganeshMohan23-Sep-07 20:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.