well, the code is not so complicated. private void display(string data) { checklength(data.length); txtdisplay.appendtext(data); } private void checklength(int num) { if((txtdisplay.text.length + num) > txtdisplay.maxlength) txtdisplay.reset(); } Anyone wants to test, creating a form with multiline textfield, just running a forever loop and passing a string to the display function. Thanks. Kyah
ahchoo
Posts
-
Text Field and Running time issue in .Net -
Text Field and Running time issue in .NetHi all, I have a program running without stop with a textfield to display data. I reset the textfield whenever its maxlength is reached. The program ran well but one day I saw my computer was restarted and I looked at the application event and saw that it was caused by Running time in .Net . I wonder if anyone knows this running time issue or a similar problem. Thanks. Kyah
-
Message="Value does not fall within the expected range."the code is very simple. void proc() { ... callreport(1, 'o'); ... } void callreport(int a, char b) { reportJob = new ExReport() //The ExReport is a Crystal Report connected to // SQL Server 2000 reported by a store //procedure with one input type char reportJob.SetParameterValue(0,b); //"The error happened at this line ... } That's all. The code looks simple but it gave me a lot of headache. Thanks
-
"Value does not fall within the expected range"Hi, I have a problem with the exception "Value does not fall within the expected range" and I haven't quite figured out what is wrong in my code. I have a store procedure that has a declared char for input. The store procedure is used by a Crystal Report filename. I want to pass a char from C# application that calls the Crystal report and passes a character to it. Somehow, I got the exception. I wonder if the character type in VS .Net 2005 is not compatible with a character type in SQL Server 2000. Any help? Thanks. Kyah:confused:
-
Message="Value does not fall within the expected range."Hi, I have a problem with the exception "Value does not fall within the expected range" and I haven't quite figured out what is wrong in my code. I have a store procedure that has a declared char for input. The store procedure is used by a Crystal Report filename. I want to pass a char from C# application that calls the Crystal report and passes a character to it. Somehow, I got the exception. I wonder if the character type in VS .Net 2005 is not compatible with a character type in SQL Server 2000. Any help? Thanks. Kyah:confused:
-
Send Mail in C# 2005I just followed the sample code in the MSDN library for Visual Studio in 2005. The exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: U able to connect to the remote server ---> System.Net.Sockets.SocketException: An est blished connection was aborted by the software in your host machine at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress s cketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s , Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncRes lt asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 imeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 tim out, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asy cCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDeleg te asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) ----------------- I just want to send a test to my network mail server not local machine. Thanks. Kyah
-
Send Mail in C# 2005HI, I got trouble of sending an email out from my application. An exception happened when from smtpclient.send object . Any suggestion? Thanks. Kyah
-
One line appears and multilines appearHi, I'd like to make a listbox display multilines to user without using scrolldown when another event is clicked. And the same listbox shows only one item when another event is clicked. Ex: when you click a button A, then a listbox B shows multilines of items. And when you click the button A again, the listbox B shows only one line. Thanks. Kyah:doh:
-
How to make cursor jump to the next text fieldThanks Roy and Stefan for your help. Kyah :-D
-
How to make cursor jump to the next text fieldHi, I'd like to make a cursor jump to the next text field when a user reach to the max length of the other in C# .Net. Ex: when you enter the key code for software installation, the cursor keeps go to the next text field without using the tab button. I'm a beginner for VS. Please help thanks. Kyah:doh: