|
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 ..
|
|
|
|
|
Its Easy as you said you have a Web Application. in your Web Application Add a New project(Web Service).
You will find it has code like this
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
namespace WebService1
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
as you can see there is example Function,
now change it to your needs , now this will be on your Web Application build it and make sure it has no Errors , in your Windows Application go to your References and right click and Add web Reference and Browse to your Web service, if you are doing this locally it will automatically show a list of web services that you created. choose one and in your Windows Appliction you will access the Web function as a Function that is created locally.
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/
|
|
|
|
|
if i connect two PCs throw cross cable ..
and i but the web app in one, and the win app in the 2nd one..
is it the same to add refrence from the web..??
|
|
|
|
|
Yes and Enter the Address of the Web Service. Remember After you created the Web service you must test it and you will see the URL that you can use consume it.
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/
|
|
|
|
|
Hi,
I have a template file in a folder " c:\template_folder".
At runtime, I will create a new folder " c:\new_folder" and wish to copy the template file to the new_folder only if the file doesnt exist.
description:
for the first time, I will copy the template file to the new_folder and rename it with username... so that after first time the loop finishes, i will have 8 excel files with username as the name of the each file.
for the second loop, if I have to copy the template file to new_folder and rename it to the username, if the file with the user name already exists, then it shouldnt copy the file to the folder.
I am addin the snippet of the code for reference.
foreach (FileInfo fi in templateFile)
{
string oldfilename = null;
string newfilename = null;
if (dir.Exists)
{
fi.CopyTo(Path.Combine(dir.ToString(), fi.Name));
FileInfo fileName = new FileInfo(fi.Name);
oldfilename = Path.Combine(dir.ToString(), fileName.ToString());
newfilename = Path.Combine(dir.ToString(), tempUserName + " " + "E" + tempUserID + " VIPv7.0.xls");
//if( !dir.ToString().Contains(newfilename))
foreach( FileInfo fileList in fileNames)
{
if (fileList.Exists == false)
File.Move(oldfilename, newfilename);
}
}
}
please help me in working this.
thanks
ramm
|
|
|
|
|
Hmmm...
if(!File.Exists("filepath"))
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|