.net

Is it possible to find some article that comprehensively compare the syntax difference VB and C# (prefer 2010 edition)?

If not, maybe someone could write such an article and the view count would go through the roof? ...

How can I get an XML attribute?

Given this XML, how can I retrive the HEX color? <group> <span style="color:#DF0000; font-style: italic; font-weight: bold">Webmaster</span> </group> I need to retrieve everything inside of the style. Then I can use the String.Substring method with .IndexOf() to retrieve the color for my use. Thank you for the help. Incase anyon...

How can I fill a Rectangle with a Hexadecimal color value?

'#10eeee' Here's what I'm trying to do: groupRectangle.Fill = Color.FromHex? Thank you for your time! ...

Invoking BindingList changed event when an item's property changes value

Hi. I have a ListBox that is bound to a ViewModel property of type BindingList(Of MyItem) (lets call it MyTrueList). The MyTrueList property actually looks at another BindingList(Of MyItem) and returns a list where MyItem.MyProperty = true. MyItem implements INotifyPropertyChanged. I also have a button whose event changes the selected i...

Exposing existing class library to WCF service

Hi guys, I have an existing class library with all the classes to communicate with my server. I've created a WCF service that will be hosted on my existing server as part of different application domain. Since I already have the classes I thought it can be exposed on my WCF service to lessen my development time. I successfully hosted m...

Input array is longer than the number of columns in this table. Exception

I'm using Following code to read CSV file contents. http://www.sendspace.com/file/l0zki3 link to download CSV file.. This is the CSV file which is located in my C:\ Drive. The exception I am getting is "Input array is longer than the number of columns in this table". Why might this happen? using System; using System.Collections.Gene...

Any good method to work with large amount of data?

I have almost 100.000 records in the database and I need to compare them to each-other with the Longest Common Subsequence algorithm, and I need to do that with 1000 new records every day. My application is written in c# .Net, and the problem is that this comparing is working slow on the application level, for comparing of 1000 records a...

What is the difference between ServiceBehavior and CallbackBehavior in WCF?

What is the difference between ServiceBehavior and CallbackBehavior in WCF? and also between contract and a behavior. ...

What happens when the client of webservice goes down - while the webservice is doing processing

Condition: 1. Client application (windows) sends a message to a webservice 2. Webservice is does some processing 3. Client application exists no more - loses it's state or deleted or down 4. Webservice finishes processing and returns a value What happens. Does the webservice throw an exception? ...

Partially protected interface but without abstract class.

I have following code. And I need to hide one function of the interface. interface IOne { int FunctionOne(); } interface ITwo { double FunctionTwo(); } interface IInterfaceToImplement : IOne, ITwo { void AFunctionToImplement(); } public abstract MyBaseClass : TheVeryHeavyBaseClass<T, IInterfaceToImplement>, IInterfaceToIm...

.net bitmap question

Hello world. I had a bug in my program, so I did some experiments and found the following code ends up throws an exception after running for a while. while ( 1 ) { System::Drawing::Bitmap^ pBitmap = gcnew System::Drawing::Bitmap( 500, 500 ); this->Cursor = gcnew System::Windows::Forms::Cursor(pBitmap->GetHicon()); } I can't...

Using MEF to Instantiate Class at Runtime

I am sure this should be easy, perhaps I am missing something obvious. I have a bunch of classes that implement the IClass interface. At runtime I want to use the MEF DirectoryCatalog to retrieve references all those classes implementing that IClass interface. So, at this point I have some kind of pool of classes that can be instantiated...

View pdf on a asp.net page

I need a secure way to display pdf documents so that the viewer can't print, copy or save the text. Something like the amazon book preview. It will be placed on a asp.net page. ...

Using the WCF DataContractJsonSerializer in .NET 3.5

I'm trying to use the geocoding code from here in my ASP.NET MVC 2 site. Unfortunately, some of that code, specifically the DataContractJsonSerializer usage, is only possible through .NET 4.0. As my hosting provider doesn't support .NET 4, I'm forced to implement that functionality in .NET 3.5. How can I rework the code (which I have re...

How can I know which method call my method?

I've 3 methods A(), B() and C(), both A() and B() call C(). In method C(), how can I know it call from A() or B()? ...

How do I specify a ruleset from MSBuild

After upgrading to VS 2010 MSBUILD /p:RunCodeAnalysis=true does not work as expected msbuild solution.sln /p:RunCodeAnalysis=true To get faster builds we removed the CODE_ANALYSIS constant for the DEBUG build. But that means thet when running the above msbuild command, it defauls to all rules, instead of using the ruleset we specified...

Implementing IErrorHandler using class level Attributes in WCF

Had no luck with getting it working via config files, so decided to attempt to go the more robust route of doign it via class level attributes. If I can get this working it is clearly a great way of wrapping exceptions in Faults in the service layer withou trepeating lots of code. However the code in the attribute never seems to get run...

How much it costs to choose .NET over the open source such us Java, Struts, etc.

Hello, Two of my colleagues (and very good friends) have worked for years in Java, PHP, MYSQL, Tomcat, Struts, and the list go really on and on. I'm (the only one who chose the .NET framework). Now, our manager has convinced our boss to invest on us and some other who are willing to go through the process. So far, battles (them vs me) t...

System.accessviolationexception Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Hi All, I am getting following error System.accessviolationexception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. when accessing a method of external dll. I have used this dll many other projects which also uses .net 3.5. This external dll uses method from another dll. All t...

Building a .NET kiosk application

Hi, I'm building a touch screen kiosk application in .NET (C#, WPF). the app itself is pretty trivial, it just collects user information. But here's where i am getting out of my comfort zone. The kiosk will be set up at remote locations, so with what I know of web development (that's what pays my bills) I can't find the kiosk but if I...