Click here to Skip to main content
16,005,162 members
Home / Discussions / C#
   

C#

 
GeneralRe: NET Lib to read / change / write MAT (MatLab) files Pin
Rene Sattler21-Mar-12 20:46
Rene Sattler21-Mar-12 20:46 
QuestionClass Diagram in C# 2010 Express? Pin
DRAYKKO77720-Mar-12 14:19
DRAYKKO77720-Mar-12 14:19 
AnswerRe: Class Diagram in C# 2010 Express? Pin
Abhinav S20-Mar-12 16:50
Abhinav S20-Mar-12 16:50 
QuestionCode Insertion Issue Pin
mauricemcse20-Mar-12 9:33
mauricemcse20-Mar-12 9:33 
AnswerRe: Code Insertion Issue Pin
wizardzz20-Mar-12 10:02
wizardzz20-Mar-12 10:02 
GeneralCode Insertion Issue [continued] Pin
mauricemcse20-Mar-12 19:48
mauricemcse20-Mar-12 19:48 
AnswerRe: Code Insertion Issue Pin
BobJanova21-Mar-12 3:13
BobJanova21-Mar-12 3:13 
Questionbackup problem Pin
nitish_0720-Mar-12 9:08
nitish_0720-Mar-12 9:08 
Hi...I didnt get a proper reply thats why i m posting it again....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)
{
if (System.Diagnostics.Debugger.IsAttached())
{
Console.WriteLine(ex.ToString());
}
else
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..
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 problem Pin
Luc Pattyn20-Mar-12 9:44
sitebuilderLuc Pattyn20-Mar-12 9:44 
GeneralRe: backup problem Pin
nitish_0720-Mar-12 23:08
nitish_0720-Mar-12 23:08 
QuestionAppending Quations to a string Pin
Arun Philip Reynolds20-Mar-12 8:18
Arun Philip Reynolds20-Mar-12 8:18 
AnswerRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 8:44
mvePIEBALDconsult20-Mar-12 8:44 
GeneralRe: Appending Quations to a string Pin
Arun Philip Reynolds20-Mar-12 9:27
Arun Philip Reynolds20-Mar-12 9:27 
GeneralRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 9:34
mvePIEBALDconsult20-Mar-12 9:34 
GeneralRe: Appending Quations to a string Pin
Arun Philip Reynolds20-Mar-12 10:17
Arun Philip Reynolds20-Mar-12 10:17 
GeneralRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 10:27
mvePIEBALDconsult20-Mar-12 10:27 
GeneralRe: Appending Quations to a string Pin
Arun Philip Reynolds20-Mar-12 10:51
Arun Philip Reynolds20-Mar-12 10:51 
GeneralRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 10:58
mvePIEBALDconsult20-Mar-12 10:58 
GeneralRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 11:01
mvePIEBALDconsult20-Mar-12 11:01 
GeneralRe: Appending Quations to a string Pin
Arun Philip Reynolds20-Mar-12 11:06
Arun Philip Reynolds20-Mar-12 11:06 
GeneralRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 11:17
mvePIEBALDconsult20-Mar-12 11:17 
AnswerRe: Appending Quations to a string Pin
Luc Pattyn20-Mar-12 9:50
sitebuilderLuc Pattyn20-Mar-12 9:50 
GeneralRe: Appending Quations to a string Pin
PIEBALDconsult20-Mar-12 10:12
mvePIEBALDconsult20-Mar-12 10:12 
GeneralRe: Appending Quations to a string Pin
Arun Philip Reynolds20-Mar-12 10:21
Arun Philip Reynolds20-Mar-12 10:21 
AnswerRe: Appending Quations to a string Pin
Luc Pattyn20-Mar-12 10:27
sitebuilderLuc Pattyn20-Mar-12 10:27 

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.