|
It appears that the code that's trying to alter the textBox is running on a seperate thread. What object is trying to alter it?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I just want to enter the value at runtime which is coming from the serial port donot have any idea about any other object
|
|
|
|
|
show these portions of your code
1. how you create your serial port reader
2. where you get the text from the serial port and attempt to assign to the textbox's Text property.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Serial Port Declaration :
private SerialPort comport = new SerialPort();
reponse from com port : string response = comport.ReadExisting()
Changing the value : textbox1.text = response.Substring(0, 1)
|
|
|
|
|
There's nothing using threading in the code you've posted. I assume you're using a thread to read the port, is your serial port declaration in there?
BTW, there's a simple example on MSDN[^] - it might be worth comparing to your code.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I guess you're setting the text from within the comport_DataReceived event handler, which the SerialProt object calls from another thread. Either you read up on threading, or you don't use the event but put a timer onto your form (or control) and poll the com port from the timer's Tick event.
|
|
|
|
|
Thanks,I had get the solution for my problem I had removed the comport_DataReceived from the event handler and now I am doing it with Timer now i am able to change the text box value at run time.
Thanks again
|
|
|
|
|
|
|
|
The answer often comes to me straight after posting too!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hey,
What is the simplest way to get a website IP Address in C#??
Thanx!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Is this what you mean?
System.Net.Dns.GetHostByName( "www..." );
edit: apparently GetHostByName is obsolete - use GetHostEntry now
----------------------------------
Be excellent to each other
modified on Monday, September 15, 2008 6:02 AM
|
|
|
|
|
Thanks! I needed something as simple but I still cant see the ip address!!
I tried
public static string GetWebsiteIP(string websiteName)
{
IPHostEntry host;
string strIP = String.Empty;
host = Dns.GetHostEntry(websiteName);
foreach (IPAddress ip in host.AddressList)
strIP += ip.ToString();
return strIP;
}
But I still get the website name I pass
GetWebsiteIP("www.codeproject.com");
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Works fine for me : returns 69.10.233.10
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Did you try my very same code to get the IP address?? nothing is changed??
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Funny! Ok, it works now, maybe I needed to clean the solution and rebuild..
Thanks for your help guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Just tried it and it works for me
Also, a domain name can map to multiple IP addresses, so you might want to return a string[] , or maybe just pick the first one?
----------------------------------
Be excellent to each other
|
|
|
|
|
Funny! Ok, it works now, maybe I needed to clean the solution and rebuild..
Thanks for your help!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
i'm trying to add a user into the ACL of a directory. i can do this fine for the user who is logged on but can't find a way of doing this for any other user in the domain.
does anyone know how to find a domain users SID?
|
|
|
|
|
Hi mister,
I have an Winforms app (Client) and Web app + WCF Services + Windows Services (Server). In server, I have installed SQL SERVER 2000.
Now, I want create a installer (MSI.exe or another Winforms app) to create a database, perhaps user, tables, stored procedures, .. Only the user introduces name of database, server, and if has Windows authentication; if not Windows authentication, I need user and password.
I have several scripts SQL, that I need execute too. If I use isql command I have problmes with codification because my scripts sql have Spanish characters. I tested with using ANSI and UTF-8 encoding for scripts .sql files, but didn't work.
Finally, how I can create this installer ? is it better MSI ?? or can I create an WinForms app ??
Any sample will be very very grateful.
Thanks in advance.
AE
|
|
|
|
|
alhambra-eidos wrote: Any sample will be very very grateful.
Try google. There's bound to be loads of samples out there.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
hi
how can i fix this problem in my connection string ?
LocalConnection = new SqlConnection("data source=localhost;database=Alarms;Integrated Security=True");
it will fixed when i substitute "localhost" with ".\\sqlexpress"
i want to work with sqlServer 2005 not sqlexpress
the error is:
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)
|
|
|
|
|
check this http://www.connectionstrings.com/[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Use
\\ComputerName\SQL2005ServerName insteed of localhost
|
|
|
|