.net

why to use finally?

Code A: try{// Some Code} catch{// Exception Handling code} finally{// Clean up code} Code B: try{// Some Code} catch{// Exception Handling code} //clean up code As far as I understand both the codes will serve the same purpose. Then why to have finally at all. ...

permanently removing source control bindings

hi,im developing web application in visual studio 2008 for the first time.. when i try to open an existing project, its asking me "Do u want to permanently remove source control binding from the project?" what does it relly mean.. how should i proceed.. Thanks... ...

byte array to double conversion in c#

I have an array of three bytes, I want to convert array into double using c#. Kindly guide me. ...

'System.OutOfMemoryException' when using Font from local system cache

hi, I have a silverlight slideshow type application ,having number of slides to display text. Each slides may have a number of TextBlock . We have requirement of Creating each TextBlock at runtime add in different panels.For each TextBlock we are assigning the value of TextBlock.Fontsource = new Fontsource(stream) .This 'stream' data is...

finally doesn't seem to execute in C# console application while using F5

int i=0; try{ int j = 10/i; } catch(IOException e){} finally{ Console.WriteLine("In finally"); Console.ReadLine(); } The finally block does not seem to execute when pressing F5 in VS2008. I am using this code in Console Application. ...

How to simulate a "open link on new window" on a C# WebBrowser?

I just found out that to simulate a click I can call element.InvokeMember("click"); where element is an HtmlElement. But what I actually need is to open the link in a new window, but not on the default browser but on another WebBrowser I would create in my program. Sometimes it works to just get the href attribute by calling element.GetA...

Rename the class in safe way?

I have .NET project using VS 2010 Pro, Some of the class name in App_Code is products (products.cs) commons (commons.cs) members (members.cs) I think it is not good naming convention,so i would to rename that, however, if i use search (products) and replace to (clsproducts) , it possible replace some text which is not the class,so i...

How to create IQueryable collections?

I am new to Linq, though I was thinking of making use of LINQ expressions to query within the collections of my business objects. We have created a new hierarchical set of models with several properties. Some properties have a List<classx>. Would I be able to change the type to IQueryable<classx>? But then how would I add a new instanc...

how to order asc/dsc with lambda or linq

how to order descending an IEnumerable<T> with linq or lambda ? ...

Nant merge task not executing

I have a Nant merge task aimed at a nunit test output.xml I have installed the relevant xsl transform files and the menu option does show up to see the NUnit details. But all the counters are zero, and inspecting the xml log file for the build I can see that the output has not been merged. Does any one have any idea why this would be? ...

How to check if an image is a scaled version of another image

Hi, I am looking for an EASY way to check if an image is a scaled version of another image. It does not have to be very fast, it just should be "fairly" accurate. And written in .NET. And for free. I know, wishful thinking :-) I am pretty sure, even without having tried it, that converting the bigger image to the smaller scale and com...

How to use a C++ class library in a .net project

My .net project needs to use a third party class library written in C++. I have already tried directly adding a reference to this DLL from the project's context menu 'Add a refence...'' but it did not work as I assume this DLL does not implement the COM object model. What options do I have now? Some suggest to create a .net wrapper aro...

How to list available ADSI (Active Directory Service Interfaces) service providers?

How can I list available ADSI (Active Directory Service Interfaces) service providers in C#? ...

Where would you send developers that want to learn .NET?

It can be extreme beginners or more experienced developers that used to code in a language like C, Perl, etc. and that wants to develop a desktop software in .NET (no ASP.NET then). I'm looking for online resources that will help them understand .NET Framework and learn how to code very simple applications. What I'm looking is content ...

Using GNU Privacy Guard in .NET

Is there some way to use GNU Privacy Guard functionality directly? Yes, I know about redirecting input/output streams from gpg.exe utility, but maybe we can use some unmanaged libraries from distribution directly? ...

What OpCodes were introduced in CLR 4.0?

Are there any IL opcodes that are new in .NET 4.0 as compared to 3.5, and if so, where can I find a list of them? ...

Server Error in '/PSS.NET' Application.

iam trying to run an application visual studio 2008.. got this error.. help me to proceed.. thanks a lot in advance. Server Error in '/PSS.NET' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error deta...

When .Net loads an assembly and how to change this behaviour?

Hello, for an application I need to check the availability of Crystal Reports runtime libraries. What I've tried is: void CheckCrystal() { try { CrystalDecisions.Windows.Forms.CrystalReportViewer test = new CrystalDecisions.Windows.Forms.CrystalReportViewer(); test.Dispose(); } ...

How to catch an event when hitting the back button?

Hi, I'm wondering if there is any way to detect when a page is being reloaded after hitting the back button of a navigator, in ASP .NET? Thanks ...

Why is Date1.CompareTo(Date2) > 0 faster than Date1 > Date2?

Another "unimportant" performance question. Unimportant because mostly code-readability is much more important than a few milliseconds, but interesting anyway. I noticed that there are differences between different DateTime Comparisons. I checked 3 alternatives: Dim clock As New System.Diagnostics.Stopwatch Dim t1, t2, t3 As Lo...