Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: i need your help in ado.net Pin
mrx10016-Mar-12 13:23
mrx10016-Mar-12 13:23 
GeneralRe: i need your help in ado.net Pin
Richard Andrew x6416-Mar-12 13:31
professionalRichard Andrew x6416-Mar-12 13:31 
GeneralRe: i need your help in ado.net Pin
mrx10016-Mar-12 13:47
mrx10016-Mar-12 13:47 
GeneralRe: i need your help in ado.net PinPopular
Richard Andrew x6416-Mar-12 13:41
professionalRichard Andrew x6416-Mar-12 13:41 
GeneralRe: i need your help in ado.net Pin
mrx10016-Mar-12 13:50
mrx10016-Mar-12 13:50 
AnswerRe: i need your help in ado.net Pin
Luc Pattyn16-Mar-12 19:15
sitebuilderLuc Pattyn16-Mar-12 19:15 
GeneralRe: i need your help in ado.net Pin
ProEnggSoft16-Mar-12 14:40
ProEnggSoft16-Mar-12 14:40 
Questionbackup Pin
nitish_0716-Mar-12 5:12
nitish_0716-Mar-12 5:12 

Hi...there is problem in backup of database.Here i m providing the code..

try
{
DateTime Time = DateTime.Now;
int year = Time.Year;
int month = Time.Month;
int day = Time.Day;
int hour = Time.Hour;
int minute = Time.Minute;
int second = Time.Second;
int millisecond = Time.Millisecond;

//Save file to C:\ with the current date as a filename
string path ;
string p = saveFileDialog1.FileName;
path = p + year + "-" + month + "-" + day +
"-" + hour + "-" + minute + "-" + second + "-" + millisecond + ".sql";
StreamWriter file = new StreamWriter(path);


ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = @"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump.exe";
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}",
"root", "123456", "localhost", "userdb");
psi.UseShellExecute = false;

Process process = Process.Start(psi);

string output;
output = process.StandardOutput.ReadToEnd();
file.WriteLine(output);
process.WaitForExit();
file.Close();
process.Close();
MessageBox.Show("backup is created");
}
catch (IOException ex)
{
MessageBox.Show("Error , unable to backup!");
}
}

}
so the problem is when pointer reach to this line-
Process process = Process.Start(psi)
then an existing event is automatically called and i dont think that this event has to do anything with it....the event is this..
C#
private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
       {
          // if (tabControl1.TabPages.Count != 1)

           {
               e.Graphics.DrawString("x", e.Font, Brushes.Black, e.Bounds.Right - 15, e.Bounds.Top + 4);
               e.Graphics.DrawString(this.tabControl1.TabPages[e.Index].Text, e.Font, Brushes.Black, e.Bounds.Left + 12, e.Bounds.Top + 4);
               e.DrawFocusRectangle();
           }
       }


so because of this i m unable to create a proper backup file...so plz give some suggestion....

AnswerRe: backup Pin
Eddy Vluggen16-Mar-12 7:09
professionalEddy Vluggen16-Mar-12 7:09 
GeneralRe: backup Pin
nitish_0717-Mar-12 2:34
nitish_0717-Mar-12 2:34 
QuestionMethod CRService.crRequest can not be reflected. Pin
NarVish16-Mar-12 1:42
NarVish16-Mar-12 1:42 
AnswerRe: Method CRService.crRequest can not be reflected. Pin
Pete O'Hanlon16-Mar-12 1:45
mvePete O'Hanlon16-Mar-12 1:45 
GeneralRe: Method CRService.crRequest can not be reflected. Pin
NarVish16-Mar-12 1:47
NarVish16-Mar-12 1:47 
Questionc# Pin
mukesh methaniya15-Mar-12 22:36
mukesh methaniya15-Mar-12 22:36 
AnswerRe: c# Pin
BobJanova15-Mar-12 23:08
BobJanova15-Mar-12 23:08 
JokeRe: c# Pin
ZurdoDev16-Mar-12 6:23
professionalZurdoDev16-Mar-12 6:23 
GeneralRe: c# Pin
R. Giskard Reventlov16-Mar-12 6:56
R. Giskard Reventlov16-Mar-12 6:56 
GeneralRe: c# Pin
computerpublic16-Mar-12 11:43
computerpublic16-Mar-12 11:43 
GeneralRe: c# Pin
ZurdoDev16-Mar-12 12:58
professionalZurdoDev16-Mar-12 12:58 
QuestionCannot Resolve Path Error Pin
computerpublic15-Mar-12 16:31
computerpublic15-Mar-12 16:31 
AnswerRe: Cannot Resolve Path Error Pin
Peter_in_278015-Mar-12 17:19
professionalPeter_in_278015-Mar-12 17:19 
GeneralRe: Cannot Resolve Path Error Pin
computerpublic16-Mar-12 1:41
computerpublic16-Mar-12 1:41 
GeneralRe: Cannot Resolve Path Error Pin
ZurdoDev16-Mar-12 6:24
professionalZurdoDev16-Mar-12 6:24 
GeneralRe: Cannot Resolve Path Error Pin
ProEnggSoft16-Mar-12 14:42
ProEnggSoft16-Mar-12 14:42 
AnswerRe: Cannot Resolve Path Error Pin
PIEBALDconsult15-Mar-12 17:40
mvePIEBALDconsult15-Mar-12 17:40 

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.