|
This is simple. You have not defined the Comm1. May be, during start you have defined and later you have commented/deleted it. Otherwise, jut re-define the Comm1.
Sr. Software Engineer
Irevna, India
|
|
|
|
|
Some serious advice. This is the code of a person who needs to buy a beginner book, and work through it, before thinking about any sort of winforms programming.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using acouple of COM objects in my project.
For example one is MS ActiveX Data Object Library.
My question is during the build these files are not copied to local but I am ending up with files in the build directory with names like 'Interop.ADODB.dll'. I thought the files were not copied to local and if they were how can I change the file name?
God Bless,
Jason
DavidCrow wrote: It would not affect me or my family one iota. My wife and I are in charge of when the tv is on, and what it displays.
I do not need any external input for that.
|
|
|
|
|
You can't change any names. The interop file is what you need with your exe. A COM file can be anywhere on your hard drive, and a local copy makes no sense, as the registry stores the path to the file.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
BTW, I did see your answer yesterday, I was busy an didn't get a chance to say thanks.
God Bless,
Jason
DavidCrow wrote: It would not affect me or my family one iota. My wife and I are in charge of when the tv is on, and what it displays.
I do not need any external input for that.
|
|
|
|
|
hi i hope i can find an answer of my question soooooon
i have a combobox column in gridview
this combobox has display member and value member
i am tring to get the value of the selected display member
to set it to another column in the gridview
how can i do it
thnx for help
MD_NADA
|
|
|
|
|
Hi,
You can check in the event handler "SelectedIndexChanged"
private void cbxbox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if (cbxbox1.SelectedValue != "")
{
/*Set the text in second combo box
or you can find the item in second combo and select it*/
cbxbox2.text = cbxbox1.SelectedValue.ToString());
}
}
I hope it will help.
-Samir.
|
|
|
|
|
|
in web form u can access the value
gridview1.FindControl("DropDownList1").value
|
|
|
|
|
hey,
does anyone knows where i can find a free source documentation about visual studion 2005? and pls i would like to know if uploading files in VS 2005 is similare to VS 2003? thank you in advance.
salie
|
|
|
|
|
My situation is this:
I'm writing an app that needs to execute a separate program (we'll call it aaa.exe) and monitor its output so that my app can display the status of aaa.exe to the user. To do this I've started aaa.exe using a Process and have redirected the STDOUT stream to a StreamReader so that I can monitor the status messages that it spits out and use that information to update a status variable. Basically, what I have to monitor the stream is this:
string line = "";
while (line = stdout.ReadLine()) != null)
{
}
and then I parse line to determine the status of the spawned application. To prevent this while loop from locking up my GUI I've moved this code to another thread, so that the status variable will continually be updated by one thread and the GUI can intermittently poll that variable from it's own thread and remain responsive to the user.
Under normal circumstances, this works well. The while loop continues until aaa.exe stops sending data to STDOUT and then the thread monitoring it exits happily and all is well. The problem arises when things don't go well in aaa.exe. It is possible under worst case scenario conditions (so this happens frequently while I'm testing) that the spawned application locks up. When this happens, my code freezes execution on the function call stdout.ReadLine() , and I now have a deadlocked thread. The most direct way to end the rogue thread is to hard kill the process for aaa.exe (using Process.Kill() ), but my boss has just informed that this is not an acceptable solution as it causes horrendous side effects to the operating environment. Using Thread.Abort has no apparent effect, it seems to wait for the next instruction to finish before doing anything to the thread which means nothing if the thread is suspended in a function call. So my question is this: is there some other way to end the Thread without killing the instance of aaa.exe, or more generally, is there some way to kill a non-responsive Thread in my application without doing a hard kill on the application itself?
|
|
|
|
|
Instead of having a dedicated thread that reads the standard output in a while loop, is it possible to just do something like:
Process proc = ...;
proc.OutputDataReceived += OutputReceivedHandler;
...
void OutputReceivedHandler(object sender, DataReceivedEventArgs e)
{
}
That way, you're in a message-based system where you don't need to spawn/rendezvous/kill other threads.
|
|
|
|
|
Nice idea. I'll definitely give that a shot when I get in to work tomorrow. Thanks for the help.
|
|
|
|
|
Hello,
I am trying to run this program in VS 2003. This runs fine but I can't see the results in Vs 2003. Infact I am not using any grid or any thing like that but using Console.WriteLine to print the results. I know that this program prints in the command prompt but I am trying to find an option so that I can see the results in VS 2003 (either command window or any other window). Is there any other line of code that I can use to print the results in VS 2003?
static void Main()
{
//Application.Run(new Form1());
// 1. Instantiate the connection
string Connection;
Connection = "Data Source='TestServer';Initial Catalog=Northwind;Trusted_Connection=sspi";
//Connection = "Data Source='TestServer';Initial Catalog=Northwind;User id=sa;Pwd=development";
SqlConnection conn = new SqlConnection(Connection);
SqlDataReader rdr = null;
try
{
// 2. Open the connection
conn.Open();
// 3. Pass the connection to a command object
SqlCommand cmd = new SqlCommand("select * from Customers", conn);
//
// 4. Use the connection
//
// get query results
rdr = cmd.ExecuteReader();
// print the CustomerID of each record
while (rdr.Read())
{
//Console.WriteLine(rdr[0]);
System.Console.WriteLine(rdr[0]);
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
// close the reader
if (rdr != null)
{
rdr.Close();
}
// 5. Close the connection
if (conn != null)
{
conn.Close();
}
}
}
|
|
|
|
|
Writeline the program endstherefore you can't see anything. If you put readline at the end i think you can hold the console window to see the result
|
|
|
|
|
Hi,
You can include
using System.Diagnostics;
and in debug mode you can write in Visual Studio output window by using
Debug.WriteLine(" xxxxxxxxxxxxxxx ");
I hope it will help
-Samir.
|
|
|
|
|
There is only one way to do this. Write the output into a text file and open that file in the VS 2003 at run time. I hope, you got answer for your question.
Sr. Software Engineer
Irevna, India
|
|
|
|
|
Hi guys,
In my myClassA:usercontrol I am drawing a rectangle but when i drag and drop this user control on a form I always have to set the width and height becuase somehow i can only see half the cricle. Is there a way when i put the control I get i can see its real state (whatever way I designed in the user control class).
Thanks
|
|
|
|
|
See if it works.
In the Load event of the control, try to set the width and height if the control.
Regards,
Arun Kumar.A
|
|
|
|
|
Hi,
Im trying to connect to a mysql server, the connection detials are below:
("Network Address=ip:3306"
+ "Initial Catalog='db1';"
+ "Persist Security Info=no;"
+ "User Name='login';"
+ "Password='pass'");
The problem is it complains that the first piece of the string isnt correcty formed. Any ideas?
Regards,
Gareth.
|
|
|
|
|
I don't use MySQL myself but just looking at your string there are three comments:
1) shouldn't "Network Address=ip:3306" be something like "Network Address=127.0.0.1:3306"
2) you use the ";" as a seperator but it's missing from the first aurument.
3) you've got quote marks "'" around most of the arguments except the first.
This would give the first line the following format:
("Network Address='127.0.0.1:3306';"
Just an idea..
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
I found this page which lists different connection strings dependant on the API (driver) you use:
http://www.connectionstrings.com/?carrier=mysql
I don't know if it helps?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hi Wayne,
Thanks for the website, looks very helpful.
Though, i have a new problem now.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Any ideas?
Regards,
Gareth.
|
|
|
|
|
Hi,
When i try to type in a textbox while running a project in VS 2005 i get the below error, any ideas what this means?, im guessing its a env setting in vs i need to change, but what?
LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
Regards,
Gareth.
|
|
|
|
|