|
yes i set the buffer size to 1024
it working but in process it threw exception couple of time "The underlying connection was closed: An unexpected error occurred on a receive."
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
Try creating the response stream (and closing it) outside of the while loop then just write the buffer contents in each loop.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Two things.
i = stream.Read(buffer,0, buffer.Length)
That's fine, but later on
reqStream.Write(buffer, 0, buffer.Length);
You try to send the whole buffer, but if you only read 215 bytes in to the buffer in the first place then you would be sending garbage.
You should use the variable you set before to make sure you only send what you read in.
reqStream.Write(buffer, 0, i);
It would probably be fine since the whole file would be put in the buffer, but just to be safe.
As for your other problem, if you use BeginWrite you need to wait until the callback before closing the stream, at the moment you could be closing the stream while you're still trying to send data down it.
If you where to use the regular Write method, you would probably want to check how many bytes where actually written and make sure you send all of your data.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hi
I have used multiple ways to restore mysql schema through c# but it doesnot seems to work as the database doesnot restores properly,
please tell me what to do, my code for restore is as under
string filename = backupName;
StreamWriter file = new StreamWriter(filename);
file.WriteLine("@ECHO off");
file.WriteLine("cls");
file.WriteLine("set DBchoice=%1%");
file.WriteLine("set User=%2%");
file.WriteLine("set Password=%3%");
file.WriteLine("set pathchoice=%4%");
file.WriteLine("");
file.WriteLine("@REM Remove double quotes from the path");
file.WriteLine("@REM SET pathchoice=%pathchoice:\"=%");
file.WriteLine("@REM SET pathchoice=%pathchoice:\"=%");
file.WriteLine("");
file.WriteLine("mysql -u " + Id + " --password=" + pwd + " " + dbName + "<" + path);
file.Close();
the other one is
StreamReader file = new StreamReader(path);
ProcessStartInfo proc = new ProcessStartInfo();
string cmd = string.Format(@"-u{0} -p{1} -h{2} {3} {4} {5}", Id, pwd, serverHost, dbName + "<", path);
proc.FileName = "mysql";
proc.RedirectStandardInput = true;
proc.RedirectStandardOutput = false;
proc.Arguments = cmd;
proc.UseShellExecute = false;
Process p = Process.Start(proc);
string res;
res = file.ReadToEnd();
p.StandardInput.Write(res);
p.WaitForExit();
file.Close();
return "Data restored successfully";
please give me any suggestions
regards,
Mariam
|
|
|
|
|
StreamReader file = new StreamReader(fromFile);
string res;
res = file.ReadToEnd();
file.Close();
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = "mysql.exe";
proc.CreateNoWindow = true;
proc.RedirectStandardInput = true;
proc.Arguments = string.Format(" -u{0} -p{1} -h{2} -D{3}", userName, password, serverName, databaseName);
proc.UseShellExecute = false;
p.StandardInput.Write(res);
p.StandardInput.WriteLine("quit");
|
|
|
|
|
I've try this code and it's work fine!
StreamReader file = new StreamReader(restoreFile);
ProcessStartInfo proc = new ProcessStartInfo();
string cmdArgs = string.Format(@"-u{0} -p{1} -h{2} {3}", UserID, Password, Location, DatabaseName);
proc.FileName = "C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin\\mysql.exe";
proc.RedirectStandardInput = true;
proc.RedirectStandardOutput = false;
proc.Arguments = cmdArgs;
proc.UseShellExecute = false;
Process p = Process.Start(proc);
string res = file.ReadToEnd();
file.Close();
p.StandardInput.WriteLine(res);
p.Close();
"&lt;" or "<" can causes error because ProcessStartInfo doesn't recognize it!
Good Luck!
|
|
|
|
|
I have been looking around because I have big dumps (200MB) and .NET kept going out of memory.
The solution is:
ProcessStartInfo proc = new ProcessStartInfo();
string cmdArgs = string.Format(@"-u{0} -p{1} -h{2} {3}", UserID, Password, Location, DatabaseName);
proc.FileName = "C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin\\mysql.exe";
proc.RedirectStandardInput = true;
proc.RedirectStandardOutput = false;
proc.Arguments = cmdArgs;
proc.UseShellExecute = false;
Process p = Process.Start(proc);
p.StandardInput.WriteLine("source " + restoreFile);
p.Close();
|
|
|
|
|
I need to develope simple sql query designer. basicaly i have problem on represent the joins. please help me to do this task.
Dushan Perera
|
|
|
|
|
Dushan123 wrote: please help me to do this task.
Any specific help you want, or should we engage our mindreading skills?
|
|
|
|
|
J4amieC wrote: or should we engage our mindreading skills?
No, save that for the forums dedicated to mindreaders
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Most of the time, this is that forum
|
|
|
|
|
J4amieC wrote: Most of the time, this is that forum
you did not have to write that, I already knew you were going to say it
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
....hmmmm, that's an interesting thought...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
I need to visualize the sql joins like sql query analyzer
Dushan Perera
|
|
|
|
|
Dushan123 wrote: I need to develope simple sql query designer
the word 'simple' strikes me as being one you clearly should not have included in a post asking for help.
I mean, if it's so simple then why do you need help with it
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
OK - what have you got so far? How are you representing your tables? What diagramming methods are you using?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi, I have a web application with a single page, where I put a textbox in that form. Then I build the project. Now I have another web application and want the previous web application page in this application. I mean I want to show the previous application's page into my current application's page as a user control.
Pankaj
|
|
|
|
|
Create a userControl and add what ever controls you want, and from your Solution Explorer Drag it and Drop it in your host page , it will be registered and you can use it.
Simple
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thanks for your replay. But this is not my problem. I have a web application not class library. And I have to show this web application form to my new web application as a control.
Pankaj
|
|
|
|
|
Hello,
Win App:
takes a value from a textbox1 and send it throw parameter to a method in the website called WebDisplay(textbox1.text)
Web App:
WebDisplay method recives the parameter.
so how can i do that..?
thanks!
|
|
|
|
|
Why Dont you Create a Web service that can be Consume by your Windows Application
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
modified on Tuesday, June 30, 2009 8:50 AM
|
|
|
|
|
sry, can u explain more ?
|
|
|
|
|
Sorry i wrote a rotten English there
ok what you should do is to create a Web service on your Web Application and in your windows Application Add a WEb reference to that Web Service and in your C# code Consume the Web service.
Tell me if you need example code.
Hope this Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Ok..
can u give me a simple project to do that.
thanks for help ..
|
|
|
|