.net

Subtract array from another in .net

Is there any easy way to remove the contents of one array from another? ...

.NET equivalent of java.util.Arrays.toString(...) methods in Java

In Java, the java.util.Arrays class have several static toString(...) methods that take an array and return its string representation (i.e. the string representation of the contents of the array separated by commas and the whole representation enclosed in square brackets -- e.g. "[1, 2, 3]"). Is there an equivalent method/functionality ...

Unable to view values of variables while debugging

I'm trying to debug portions of the current application I'm working on, however when I try and check the value of a property/variable I get the error: Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. This is just a regular ASP.NET project. ...

Smallcaps / multiple fonts and bolding using 'DrawString' in GDI+

I want to write out some text using smallcaps in combination with different fonts for different words. To clarify I might want the message 'Welcome to our New Website' which is generated into a PNG file for the header of a page. The text will be smallcaps - everything is capitalized but the 'W', 'N' and 'W' are slightly larger. The 'N...

Is it OK to write new apps for .NET yet ?

I'm about to start a new Windows app. It will be an audio processing tool written in C++. It will need all the usual GUI stuff like menus, toolbars etc. It will also have an embedded web browser. I'm thinking of building it on .NET but I'd like to hear from you all on whether .NET is still a pain to deploy. What percentage of regular us...

WebMethod response format

I recently saw a jQuery example where a POST was made to "Default.aspx/Test", where Test was a WebMethod in Default.aspx, and the content-type for the request was "application/json". The reply from the WebMethod was in JSON. I always thought WebMethods returned SOAP responses, but if I'm interpreting this code correctly, like I said, th...

Update linked tables in MS Access Database with C# programatically

I have two Access 2003 databases (fooDb and barDb). There are four tables in fooDb that are linked to tables in barDb. Two questions: How do I update the table contents (linked tables in fooDb should be synchronized with the table contents in barDb) How do I re-link the table to a different barDb using ADO.NET I googled but didn't g...

How do I see memory allocation in a given .NET application?

I need to check how much memory is allocated in the heap. Is there a way to get this value programmatically with C#? I know about the System.Runtime.InteropServices.Marshal.SizeOf(...) but that only tells me the size of an object. ...

Canceling a programatically started SQL Server Express Install

During my application setup, the user has the option of installing a new SQL Server Express 2005 instance in the local machine if they don't want to use an already existing SQL Server 2005 in their network for whatever reason. As the SQL Server installation is optional, I don't have it as a prerequisite of my installer. Instead, I just ...

Sending a POST request: System.Net.WebException

This is not the first time I'm using this method to send a POST request, and I never had any problems: public static Stream SendPostRequest(Uri uri, byte[] postData) { var request = WebRequest.Create(uri); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request....

Debug with an incompatible Visual Studio, but with .pdb

Okay, weird situation: I need to Debug a VSTO Office Addin. This was written in Visual Studio 2008 Professional and debugging is usually done by loading the Project, Attaching to Outlook.exe and setting breakpoints - works fine. But I gave a situation where it does not work as expected on one machine, but I do not have VS2008 Pro on tha...

Any real Silverlight projects?

Appart from projects funded/pushed by MS itself, are there any real-world examples of projects that opted for Silverlight? What were your experiences? Learning curve? Advantages? Resources? Pitfalls? Sacrifices? --EDIT-- I'm most interested in the developing (team)'s story. ...

Webservice return type changes unexpectedly

I Integrate a web service that returns several DataTables. When I update webservice reference, sometimes some methods' return type changes from DataTable to a class that looks like an array of 2 items (one for schema other for datatable). In browser we look at the reference datatable looks like that : <?xml version="1.0" encoding="u...

.Net vs Java for mobile development. What's your take?

Hi there, I am developing mobile apps for some time in .NET and I was always wondering if the grass is greener on the other side (Java). Thus, I would like to ask your opinion about which one you prefer for your mobile apps and why is that so. ...

Dictionary(words such as names, items, etc) library for .NET?

I am looking for a library that can be used in .NET to retrieve strings of random names(John, Peter), items(table, bottle), objects etc I want to use this in a database-filling operation and the requirement is that the data should look real. ...

WinForms Volume Slider/Trackbar User Control

Hi All, I'm looking for a trackbar-like user/custom control to use in my .NET 2.0 WinForms app. Note: I'm NOT asking how to control the volume in a WinForms app. Anyone knows of a nice looking custom painted slider/trackbar control that could be used in my app to let user set the volume? (such as the ones used in multimedia apps) Id...

.net compact framework "Target framework"

With normal .net applications in the properties window you can change the .net framework of your application from 3.5 to 2.0. I'm looking for something like that for a pocket pc application, because I get an error on my pocket pc that my app requires a newer version of .net. and I can't find it anywhere in the properties. ...

Source file Encoding in Visual Studio (VS2005 but can apply to other versions)

Is there an option to easily view the current file's encoding (utf-8, utf-8 w/out BOM, ascii, western, etc)? I am working mostly on the web applications, so this is crucial to me. I can't find this anywhere besides the "Save as" dialog... When you are saving a file in Visual Studio, you can choose "Save MyClass.cs as", and then click o...

Omitting all xml namespaces when serializing an object?

The code looks like this: StringBuilder builder = new StringBuilder(); XmlWriterSettings settings = new XmlWriterSettings(); settings.OmitXmlDeclaration = true; using (XmlWriter xmlWriter = XmlWriter.Create(builder, settings)) { XmlSerializer s = new XmlSerializer(objectToSerialize.GetType()); s.Serialize(xmlWriter, objectToSer...

How to cast object/structure into arraylist??

I have a structure in C#.net. I have created an object of that structure. I need to cast this object of structure into ArrayList. I am using : OrderMessageStructure.OrderMessage orderToModify = new OrderMessageStructure.OrderMessage(); object neworderobject = (object)orderToModify; ArrayList arr = new ArrayList(); arr = (ArrayList)new...