.net

How to make a class protected for inheritance?

I would like to do the same thing I do in Java with the final keyword. I tryed to use const keyword... but it doesn't work. How can I prevent other class to inherit from my class? ...

Access to the path 'c:\ApplicationFolder' is denied.

I am getting a strange error on a remote windows clients (WinForm application using C# 2.0) Error Message: Access to the path 'c:\ApplicationFolder' is denied. Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 right...

.NET Sample VCF Reader

Does anyone know of a good sample (inline in reply, or web tutorial) for extracting data from a VCF file using C#/.NET? Does anyone use VCF files anymore? Is this even worth doing for a contact management system? ...

Linq 2 SQL or Linq Entities

I am starting to design a new application and what I am wondering is peoples opinions on Linq2SQL or Linq2Entities and what they feel is the better technology for rapid development. I am also doing some research into ADO.net data services. ...

Extract column of doubles from a DataTable

Is there an easier way to achieve the following? var obj = from row in table.AsEnumerable() select row["DOUBLEVALUE"]; double[] a = Array.ConvertAll<object, double>(obj.ToArray(), o => (double)o); I'm extracting a column from a DataTable and storing the column in an array of doubles. Assume that table is a DataTable contai...

Are there languages compatible with .NET that don't support unsigned types?

Let's say that I'm writing a library in C# and I don't know who is going to consume it. The public interface of the library has some unsigned types - uint, ushort. Apparently those types are not CLS-compliant and, theoretically speaking, there may be languages that will not be able to consume them. Are there in reality languages like ...

Code generator (.net)

Do you have any experience with T4 and T4 Editor? Can you compare it to CodeSmith or MyGeneration? What code generators do you use? What do you recommend? I want to use it for generatig of SPs. Is there anything else you find code generation useful? ...

In what ways do you make use of C# Lambda Expressions?

Pour in your posts. I'll start with a couple, let us see how much we can collect. To provide inline event handlers like button.Click += (sender,args) => { }; To find items in a collection var dogs= animals.Where(animal => animal.Type == "dog"); For iterating a collection, like animals.ForEach(animal=>Console.WriteLine(animal.Na...

What's Your Favorite C# Open Source Project of the year 2008?

C# Open Source Project Of The Year Award 2008 Let us decide which project should receive the honor, from the Stack Overflow community. And as the best programming community, I think the community opinion matters. What's the best Open Source Project you've found, and loved in 2008? List it here, and let the community vote for the sa...

Are there any API wrapper of Robocopy?

Robocopy is the best reliable and feature rich way to batch copy files on Windows. However, it is a command line tool. I am looking for a library/API that I could do the same in my program. I tried to use Process.Start(), but then I have to capture and to parse stdout for progress bar and no way to the overwrite behavior. For example, ...

XML to CSV Using XSLT

I have the following XML document: <projects> <project> <name>Shockwave</name> <language>Ruby</language> <owner>Brian May</owner> <state>New</state> <startDate>31/10/2008 0:00:00</startDate> </project> <project> <name>Other</name> <language>Erlang</language> <owner>Takashi Miike</owner> <state> C...

PDF generation

We currently send an email notification in plain text or html format. Our environment is C#/.NET/SQL Server. I'd like to know if anyone recommends a particular solution. I see two ways of doing this: dynamically convert current email to pdf using a third party library and sending the pdf as an attachment or use SSRS to allow us...

Are event callbacks with (object, EventArgs) parameters a holdover from 1.1 and WinForms?

So I have started playing around with FxCop lately and one thing I've noticed is it insists that any method attached to an event should be in the form void Callback(object sender, EventArgs args) { ...} and to be attached with MyObject.Event += new EventHandler(Callback); Now that was all well and good back in the .Net 1.1 days but...

Is there a simple & extendable Data Class for ASP.NET?

I've worked with a few of these in the past, but I'm looking for a good, reliable and extensible data class for ASP.NET 3.5, that I can adopt and extend for future projects. I'm not looking for LinQ, and I don't want anything which won't be a source-code level solution. Ideally, it also won't be heavy. Simple.Best Practices.Easy to Imp...

.NET: ArrayList vs List

What is the difference between ArrayList and List in VB.NET ...

Questions every good .NET developer should be able to answer?

My company is about to hire .NET developers. We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question is: What questions do you think should a good .NET program...

What is a satellite assembly?

What is a satellite assembly, and when should they be used? ...

Smart navigation

What is smart navigation in .NET? ...

In .NET which loop runs faster for or foreach

In c#/VB.NET/.NET which loop runs faster for or foreach? Ever since I read that for loop works faster than foreach a long time ago I assumed it stood true for all collections, generic collection all arrays etc. I scoured google and found few articles but most of them are inconclusive (read comments on the articles) and open ended. Wha...

Is this compact framework program running on the desktop?

One of the cool things about the .NET Compact Framework is that you can run .NETCF executables on the desktop version of Windows. However, there are minor incompatibilities between the platforms that have to be dealt with at run-time. My question is, how do I tell which platform I'm on right now? ...