Topics
-
-
- Leaders
- 4 replies
- 8.6k views
I have a class (Log) that I use to log all my applications information into a single log file (text file), this class is accessed from many different threads all wanted to write to the same log file using the same Log.Trace(sMessage); static function... Thing is - and correct me if I am wrong - but the way I am doing it seems extremely prone to contention, errors, and just generally not thread safe... Currently this is the code I use to peform all my logging operations.... public class Log { static StreamWriter ErrorLog; public Log() {} public static void LogStart(string sFile) { // Open Tracer Log File ErrorLog = new StreamWriter(File.Open…
Last reply by snarfblam, -
-
- 1 reply
- 1.9k views
I have a multi select list box that is bound to a datatable. I am trying to retrieve the user's selections from the list box. I am using the code below. foreach (System.Data.DataRowView item in lstServices.SelectedItems) { MessageBox.Show(item.ToString()); } The message box displays System.Data.DataRowView. How do I get it to display the actual value of the selected item - both the display value and the bound value? Thanks for your help. Weste
Last reply by Weste, -
- 1 reply
- 1.2k views
I am trying to set the timeout of my site to 20 minutes, however I cannot seem to get it to work. Some pages will timeout after about 5 minutes, others will do so after 60 minutes. Here is what I have done so far: 1. I have set the timeout value in the web.config file: <authentication mode="Forms"> <forms name="www.abc.eu" loginUrl="Index.aspx" timeout="20" /> </authentication> 2. I went to IIS, selected Virtual Directory and clicked on the Configuration button. In the Options tab, I set the session timeout value to 20 minutes and left the ASP Script timeout at 90 seconds. 3. Still in IIS, I selected the Http Headers tab and have sel…
Last reply by mike55, -
- 2 replies
- 2.5k views
Hi I am getting a strange error. "Collection was modified; enumeration operation may not execute." I am loading a dataset with data from a sql server stored procedure. Using this code: _db.LoadDataSet("SR_USER_MNE_ALL", dsFlux, New String() {"User"}) It uses Microsoft�s patterns and practices data access. It has only recently started happening after some new users were setup in the database. I have checked the data being returned and it matches the dataset requirements for this table. The code is not running in a thread and the datatable is wiped before this code runs. Does anyone have any ideas? Thanks in advance.
Last reply by jch001, -
-
- Leaders
- 2 replies
- 2.7k views
Anyone know why Label.font.size and Label.font.bold are read only at runtime in .NET? Is there a work around?
Last reply by bjwade62, -
-
-
- Leaders
- 5 replies
- 1.4k views
In the form designer Autosize is not listed for textboxes. But in code you can set the autosize prop to False. By default it's True I think. Do i really have to go in and set this stuff up with code? By default it seems you can size the width of the textbox, but not the height. I'm sure there's some simple solution that I dont know about.
Last reply by NeuralJack, -
-
- 3 replies
- 1.6k views
Hi I am requesting you to post any free asp.net hosting you know, so that newbies will be able to put their work on the web. Regards sudershan thaiba :cool:
Last reply by Eduardo Lorenzo, -
-
- Leaders
- 3 replies
- 1.3k views
I have 3 Forms - Form1, Form2, and Form3. Both Form1 and Form2 have a button to open Form3. Form3 displays differently depending on whether Form1 or Form2 opened it. What i the best way using C# to determine which form opened Form3? Thanks for the help! Weste
Last reply by snarfblam, -
-
-
- Administrators
- 21 replies
- 10.3k views
The Operator "=" is not defined for type "Object" and type "Object" The following code doesn't work: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim a As New Object Dim b As New Object a = b Dim c As New Object Select Case a Case b Text = "a is b" Case c Text = "a is c" End Select End Sub End Class because "The Operator "=" is not defined for type "Object" and type "Object"". This seems like a missed opportunity to provide a useful capability in the language. There's no way around th…
Last reply by rbulph, -
-
-
- Administrators
- 9 replies
- 3.2k views
I read this blog: http://weblogs.asp.net/scottgu/archive/2006/07/12/Recipe_3A00_-Enabling-Windows-Authentication-within-an-Intranet-ASP.NET-Web-application.aspx 1. IIS6.0, windows server 2003, SP1 2. I setup my site. Disabled Anonymous access. Enabled Windows Intergrated Authentication. 3. I do not use impersonation 4. I have the webconfig exactly as that blog has it: <authentication mode="Windows" /> <authorization> <deny users="?"/> </authorization> 5. I added ASPNET useraccount to the folder with "Read&Execute", "Read" and "List Folder Contents" permission. When I bring up the site, I get a pop…
Last reply by eramgarden, -
-
- 2 replies
- 1.2k views
I have a program that samples the serial port continually based on a number the user provides. Ive been trying to get an event to STOP the loop with a button without success. For example: While stop_button = false for user_count = 1 to variable_number serialportx.readline ' here I want to trap an event that sets user count to 20 or stop the for loop ' from executing. next end while Any ideas? I never can get the following when the loop is executing. 1. A button click event to return a TRUE 2. a status of the button (TRUE or FALSE) to print to a textbox. 3. Any user control to be visible or not visible What is it about the loop that…
Last reply by techmanbd, -
- 2 replies
- 1k views
Hello folks, It's been a while since I last posted here... I would love to know how can I startup my .NET v2.0 project with a class instead of a form. I could do this in v1.1 but I don't know how to do this in 2.0. Thank you :)
Last reply by EFileTahi-A, -
- 1 reply
- 1.1k views
I have a main application [frmMain] that launches threads (tcp listeners) - at a certain point I want to STOP these threads (which will close my listener, sockets, and abort the thread - this all works fine). Thing is it also launches 2 exceptions: - SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall - ThreadAbortException: Thread was being aborted. This is my current CATCH-phase code: catch (SocketException sex) { Log.Trace("Socket Exception: " + sex); } catch (Exception ex) { Log.Trace("General Exception: " + ex); } Now I am pretty sure I can catch the Thread Abort Exception using: "catch (ThreadAbortException) {}" fir…
Last reply by Gill Bates, -
- 1 reply
- 2.1k views
Hey people does anyone know how to detect a usb device connection or can provide me witha link? thanks in advance
Last reply by mandelbrot, -
-
- Leaders
- 18 replies
- 1.5k views
If you expose an object to a plug-in you are opening yourself up to the possibility that the plug-in might change properties of the object. This is because the object will be passed ByRef even if the procedure that the plug-in implements declares the object parameter as ByVal (try it if you don't believe me). So is there a way to effectively make all the properties of an object read-only to certain dlls? I suppose you could do this by having a flag to be set when the object is passed out to a plug-in, and checking for the state of this flag in every Property Set in your object. But it's a bit tedious. Is there a better way?
Last reply by rbulph, -
-
-
- Administrators
- 1 reply
- 1k views
Can someone tell me how to use an embedded resource at runtime using C#? the VB.Net method is: My.Resources.resourceName
Last reply by PlausiblyDamp, -
-
-
- Administrators
- *Experts*
- Leaders
- 3 replies
- 6.7k views
I have managed to put together some code (with help from other coders) that will capture my desktop into a bitmap variable, however now I need to convert this into a byte variable so that I can then insert into my image field within SQL server db. Is anyone able to help me, I have search the net and I seem to find loads of example where you are reading a image from a file, however I can find nothing to help me with this. Thanks in advance Simon
Last reply by snarfblam, -
-
-
- Leaders
- Administrators
- 3 replies
- 4.8k views
How can I change from .NET (VB or C#) the system default short date format. Manually, I can do that by going to control panel\Regional and Language Options\Customize\Date\Short Date Format
Last reply by snarfblam, -
-
-
- Administrators
- 2 replies
- 856 views
My superiors have decided that they want all code converted to C#. I have figured 99% of it out, but I am stuck on the line below. Can anyone help? ds.Tables(0).Rows(lineCnt).Item(64) = sOD1 I tried ds.Tables[0].Rows[lineCnt].Item[64] = sOD1; and it returns this error "ds" is a dataset
Last reply by kcwallace, -
-
-
- Leaders
- 9 replies
- 5.7k views
Hai, I've a Windows Forms with a Button and AxWebBrowser, and i've loaded AxWebBrowser with a dynamic HTML page (with a javascript function). My problem is, How do i invoke javascript by clicking on the button which is available on Windows forms. (i've tried some thing but no joy...) Sample HTML Code --------------------- <html> <head> <script language=javascript> function somefunction() { alert ("Function sucessfully executed..."); } </script> </head> <body> bla....bla... </body> </html> in VB.NET ------------ AxWebBrowser.Document.ParentWindow.execScript("somefunction()", "JScript") Thanks in…
Last reply by bcorrea, -
-
Who's Online 0 Members, 0 Anonymous, 54 Guests (See full list)
- There are no registered users currently online