Click here to Skip to main content
15,888,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: using StretchDIBits() functions in C# Pin
Christian Graus13-Apr-08 18:12
protectorChristian Graus13-Apr-08 18:12 
GeneralBackup and Restore MySql Database Using C# Pin
joie717013-Apr-08 17:16
joie717013-Apr-08 17:16 
GeneralRe: Backup and Restore MySql Database Using C# Pin
Razvan Dimescu13-Apr-08 19:59
Razvan Dimescu13-Apr-08 19:59 
GeneralRe: Backup and Restore MySql Database Using C# Pin
joie717014-Apr-08 18:30
joie717014-Apr-08 18:30 
GeneralRe: Backup and Restore MySql Database Using C# Pin
Razvan Dimescu14-Apr-08 20:10
Razvan Dimescu14-Apr-08 20:10 
GeneralRe: Backup and Restore MySql Database Using C# Pin
joie717015-Apr-08 20:08
joie717015-Apr-08 20:08 
GeneralRe: Backup and Restore MySql Database Using C# Pin
Member 471213810-Mar-09 4:01
Member 471213810-Mar-09 4:01 
GeneralRe: Backup MySql Database Using C# Pin
Member 54962299-Apr-09 0:55
Member 54962299-Apr-09 0:55 
string fname = txtFileName.Text;

if (fname == "")
{
MessageBox.Show("Please Enter the File Name!");
return;
}

try
{
btnBackup.Enabled = false;
DateTime backupTime = DateTime.Now;
int year = backupTime.Year;
int month = backupTime.Month;
int day = backupTime.Day;
int hour = backupTime.Hour;
int minute = backupTime.Minute;
int second = backupTime.Second;
int ms = backupTime.Millisecond;

String tmestr = backupTime.ToString();
tmestr = "C:\\Program Files\\MySQL\\MySQL Server 5.0\\bin\\" + fname + year + "-" + month + "-" + day + "-" + hour + "-" + minute + ".bak";
StreamWriter file = new StreamWriter(tmestr);
ProcessStartInfo proc = new ProcessStartInfo();
string cmd = string.Format(@"-u{0} -p{1} -h{2} {3}", "root", "password", "Server", "dbname");
proc.FileName = "mysqldump";
proc.RedirectStandardInput = false;
proc.RedirectStandardOutput = true;
proc.Arguments = cmd;//"-u root -p smartdb > testdb.sql";
proc.UseShellExecute = false;
Process p = Process.Start(proc);
string res;
res = p.StandardOutput.ReadToEnd();
file.WriteLine(res);
p.WaitForExit();
file.Close();
MessageBox.Show("DataBase Backup Has Been Completed Successfully!");
btnBackup.Enabled = true;

}
catch (IOException ex)
{
MessageBox.Show("Disk full or other IO error , unable to backup!");
}

txtFileName.Text = "";
Generalshape area in images Pin
vodas13-Apr-08 15:49
vodas13-Apr-08 15:49 
GeneralRe: shape area in images Pin
Christian Graus13-Apr-08 15:54
protectorChristian Graus13-Apr-08 15:54 
GeneralRe: shape area in images Pin
Razvan Dimescu13-Apr-08 20:01
Razvan Dimescu13-Apr-08 20:01 
GeneralRe: shape area in images Pin
Christian Graus13-Apr-08 20:54
protectorChristian Graus13-Apr-08 20:54 
Generalset the position for the content in richtextbox. Pin
kamalesh574313-Apr-08 15:46
kamalesh574313-Apr-08 15:46 
GeneralDrag and Drop Pin
Stevo Z13-Apr-08 13:05
Stevo Z13-Apr-08 13:05 
GeneralRe: Drag and Drop Pin
Christian Graus13-Apr-08 13:34
protectorChristian Graus13-Apr-08 13:34 
GeneralDateTimePicker and DataBase Pin
half-life13-Apr-08 9:48
half-life13-Apr-08 9:48 
GeneralRe: DateTimePicker and DataBase Pin
Guffa13-Apr-08 11:23
Guffa13-Apr-08 11:23 
QuestionAdding data to ComboBox Pin
Alessandra7713-Apr-08 6:35
Alessandra7713-Apr-08 6:35 
GeneralRe: Adding data to ComboBox Pin
Thomas Stockwell13-Apr-08 6:54
professionalThomas Stockwell13-Apr-08 6:54 
GeneralRe: Adding data to ComboBox Pin
Alessandra7713-Apr-08 7:30
Alessandra7713-Apr-08 7:30 
General[Message Deleted] Pin
Laddie13-Apr-08 4:09
Laddie13-Apr-08 4:09 
GeneralRe: Question on ?: operator Pin
Matthew Butler13-Apr-08 4:27
Matthew Butler13-Apr-08 4:27 
GeneralRe: Question on ?: operator Pin
Laddie13-Apr-08 4:31
Laddie13-Apr-08 4:31 
GeneralRe: Question on ?: operator Pin
GuyThiebaut13-Apr-08 4:34
professionalGuyThiebaut13-Apr-08 4:34 
QuestionCreating a subform Pin
Muhammad Gouda13-Apr-08 2:57
Muhammad Gouda13-Apr-08 2:57 

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.