.net

Can anyone show a sample of two threads reading messages from a Queue(of String)?

I'm trying to improve performance of an application by introducing threading (see my earlier question). I have filled a Queue(of String) with XML messages and I now want to setup two threads to post these messages to a webserver). This process needs to ensure that each message is only posted once. Would a BackgroundWorker (or two) be sui...

HttpPostRequest Text+File in vb.net

Hi, HttpPostRequest with Files only in VB2008 is easy: Using wc As New System.Net.WebClient() wc.UploadFile("http://server.de/exemple.php", "c:\test.png") End Using But I want POST Text + Files in one POST (username, password, file). But, how to? ...

Should we use "workstation" garbage collection or "server" garbage collection?

I have a large multi-threaded C# application running on a multi-core 4-way server. Currently we're using "server mode" garbage collection. However testing has shown that workstation mode GC is quicker. MSDN says: Managed code applications that use the server API receive significant benefits from using the server-optimized garbage ...

Error in Properties of .net Project & Designer file is locked.

Designer file is locked and when go to project properties it gives this error. An error occurred trying to load the project properties window. Close the window and try again. The CurrentContext property of the LicenseManager is currently locked and cannot be changed. .net framework 3.5 VS 2008 ...

FlowDocument Force a PageBreak (BreakPageBefore)

hi, I'm using C# to create a FlowDocument and fill it with data within a table. Example: FlowDocument flowDoc = new FlowDocument(); Table table1 = new Table(); flowDoc.Blocks.Add(table1); table1.RowGroups.Add(new TableRowGroup()); table1.RowGroups[0].Rows.Add(new TableRow()); TableRow currentRow = table1.RowGroups[0].Rows[0]; table...

How does Object.GetHashCode work when the GC moves an object?

If I understand correctly, in .NET the default implementation of Object.GetHashCode() returns a value based on an object's memory address (at least for reference-types). However, the garbage collector is free to move objects around in memory. Presumably the hash code doesn't change just because the GC moves an object, so is there special...

How to make the default value of a type as Nothing?

For example Dim aInt as Integer should have the value as nothing instead of 0. ...

Data committed even though System.Transactions.TransactionScope.Commit() not called

Under what circumstances can code wrapped in a System.Transactions.TransactionScope still commit, even though an exception was thrown and the outermost scope never had commit called? There is a top-level method wrapped in using (var tx = new TransactionScope()), and that calls methods that also use TransactionScope in the same way. I'm...

Is File.Exists an expensive operation?

Re: http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx Does anyone know if this is a particularly slow or locking operation which could impact server performance in a large environment? Thanks, Matt. ...

Windows Dialogs: when to use "OK + Cancel" and when to use "Save+Cancel". Is a Windows standard?

When does one use OK+Cancel in a dialog and when "Save + Cancel". I have seen them used interchangeably. Is there a window standard? ...

Informix ODBC Connection Help

I have a development project that requires us to be able to support informix data sources via ODBC. I've downloaded the prebuilt Informix Virtual Appliance from the IBM website and am able see the server with the built in tools, but haven't been able to get at it from an ODBC connection on the client! I have the ODBC support package ins...

Customize DataColumn.Expression handling in C#

I would like to change behavior of DataColumn.Expression so that when I write: DataColumn.Expression = "MyMethod(Price)" it will call MyMethod, pass value from Price column into it and display evaluated value. How to acomplish this? ...

Spelling Suggestor in ASP.NET

Hi All, I need to build a spelling suggestor in ASP.NET... The below are my requirement. Case 1: My list of words are not just englist words but will also includes some codes like AACD, ESSA, BIMER etc... I may provide such (New) words from Database. Case 2: I also need a similar spelling suggestor for Non-English Language, Even he...

C# .net equivilent of HTTP_RAW_POST_DATA?

Want to mimic php code in c# . I want to Capture raw image data posted from the following Flash Actionscript: function onSaveJPG(e:Event):void{ var myEncoder:JPGEncoder = new JPGEncoder(100); var byteArray:ByteArray = myEncoder.encode(bitmapData); var header:URLRequestHeader = new URLRequestHeader("Content-t...

new ServiceHost for every WCF service ?

First,Im running a windows service that should contain a lot of funcionality.There will be a business layer and the results comming from this business layer will be sent over WCF to the presentation layer. I dont know how to structe all this functionality. So my questions are : 1. Should I create somekind of a Facade pattern class tha...

How to avoid creation of xml tag for properties which has the value Nothing in WCF?

Suppose i have a service, where i give some input , and i am setting the properties of Name and Age as Nothing Name and Age are nullable types. Now as Name and Age are nothing i do not want a xml tag generated in the output.But below xml tags are generated with nil=true. <Name xsi:nil="true"/> <Age xsi:nil="true"/> ...

Outlook is unable to accept french-accented characters in my mailto string?

Outlook is causing some problems when being passed a mailto string with accented characters in it. Changing the codepage for my entire webpage that has this string on it solves this problem, but that causes other problems in the system, so I would not like to do that. A string like such returns a lot of garbage characters: "mailto:H...

How to remove xmlns and z:Id z:Type after serialize with NetDataContractSerializer

After NetDataContractSerializer.Serialize (), the xml content contains extra information such as xmlns, z:Id, z:Type, z:Assembly, etc. We only need the data members information that were in the serializable class. Is there an easy way to get rid of those auto-generated information? I have found a solution for xmlserializer but not netd...

How Do I copy an existing nhibernate object as a new object?

I a persisted NHibernate object that I would like to repersist as a new entity. How do I get NHibernate to save this object as if it was a new? I am thinking I might create a session interceptor to force every entity to look new and ensure the id is left blank like a new unpresisted entity would. ...

.NET Team - Best Practices and Methods

Hi, What best practices and methods would you enforce on a new .NET development team? Cheers ...