.net

Custom providers using XML as their data store - should I use XPath/XSLT or DOM?

Hi I’d like to learn how to create custom providers ( say custom membership provider or custom profiles ) that use XML as their data store. Is ( using C# ) best way to accomplish this using XPath/XSLT or DOM? thanx ...

.Net: What exactly is an "open generic type"

I was going through Asp.Net MVC lesson and learned that, for a method to qualify as an action for a controller, It must not have an "open genric type" I understand generics some how and use them as well to some extent, but what is an open generic type in .Net. Is there something as closed generic type ? open genric type is a term ...

.NET/Mono Install Base

Me and some friends are considering writing a new FOSS project, and the debate is divided between using .NET or something else. So I am wondering if there is an advertised install base for Mono on Linux machines? and, if there known install base of Mono or the Microsoft .Net on windows machines? Thanks. Install Base - A measure of t...

ICustomTypeDescriptor for simulating strong-typing

I thought about simulating strong-typing for key-value configuration of a new project by providing fake property info via implementing ICustomTypeDescriptor. The configuration instance should provide all default config keys as properties with default values however: I noticed that VS08 intellisense doesn't include "faked" properties whi...

When is an app.config created, when an app.exe.config and what is the difference

We have created a WinForms application and store some configurations via the ConfigurationManager class. In order to store the information I use Configuration pConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); pConfig.AppSettings.Settings.Add("updates", szUpdatesURL); pConfig.Save(ConfigurationSaveMode.Mo...

Are there commercially deployed and used .NET CAS (Code Access Security) based applications?

I've seen a couple threads here on SO that ask about what CAS is and how to use it.My specific is specifically focused on real-world usages of CAS. For example: DotNetNuke did some efforts in the past to be able to run under Medium Trust: is that still true? what is the % of DNN that run in partial trust (i.e. not full trust)? what &...

MVVM View Model DTOs

I have a WCF based application that uses the services to access repositories on the server side. I am passing DTOs from the server to the client and was wondering how best to make the DTOs part pf the view model. I have a workign example of just plain properties on the view model but was unsure how to deal with actual DTO objects and a...

ConnectionString not read from web.config by a strongly typed Dataset? SQLiteException (0x80004005): unable to open database

Please some help on how to debug this! On my development machine I can succesfully host a local WCF service that uses a SQLIte database for its storage. I simply xcopied the wcf service dll's, the database file and the System.Data.SqLite.dll to the win 2008 server. The server hosts the the WCF service in IIS7.This worked without a hitch...

How Do I Extract a Full Icon From a Vista/7 Executable?

If I have a Vista .ico file which contains a 16x16, 32x32, 256x256 etc. version of an icon, I can successfully load it as a .NET Icon by simply doing -: Icon myIcon = new Icon("C:\\MyIcon.ico"); I can then access all of the various sized images in the icon. I can even access the 256x256 Vista PNG using methods detailed HERE. However...

Extracting URLs using regex in .NET

I've taken inspiration from the example show in the following URL csharp-online and intended to retrieve all the URLs from this page alexa using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Text.RegularExpressions; namespace ExtractingUrls { ...

How to Determine SQL Server Service has started fully and all databases are online

With some slower machines that our application runs on (which is in the windows startup folder), when the machine is Rebooted and autologged on, the SQL Server service is still in a starting up state when my application is launched. (SqlServer 2005) What I've done to counter this is to Check the Service state (MSSQL$idealsql) and wait ...

How can I save a "setting" in a C# application?

A user wants me to create an app that does something everything he presses the X key. Now he asked me to make it so he can change what key he has to press. Maybe he wants X key today, maybe C key tomorrow. How can I easily do this in C#? What is the best way? ...

What variable should I use if I want to save time values?

I want to make an app that adds 1 minutes and 25 seconds to a TimeLeft variable. Problem is I have no idea what type of variable this should be, or even how to add 1 minutes 25 seconds to the available time left. Any guidance would be much appreciated. I'm good with C#, but since I've never done something like, I'm in the dark. ...

How to download a file in pieces with many threads

Hi, I need to download a file from a website using different threads and downloading different sections of the file at once, I know I can use Webclient.downloadfile method but it doesnt support downloading a file in chunks. If you could point to a tutorial or give me an idea on how to do it I would appreciate it. Thanks! ...

How Do I Create a System.Drawing.Icon with Multiple Sizes/Images?

I would like to create a single System.Drawing.Icon programmatically from 32x32, 16x16 Bitmaps. Is this possible? If I load an icon with - Icon myIcon = new Icon(@"C:\myIcon.ico"); ...it can contain multiple images. ...

programming a stopwatch

i would like to make a site that is like this one: http://www.online-stopwatch.com/ i know a vb.net and little bit of everything else and am wondering what is the best platform to use to make this and how i can start to make this stopwatch? ...

.NET, C#: How to add a custom serialization attribute that acts as ISerializable interface

I am doing some serialization of db linq objects, which contain EntitySet and EntityRef classes. I found a pretty easy way to deal with serialization of these classes, by simply using ISerializable to properly handle members of this type (converting them to lists for serialization, and undoing it on deserialization). However, it would ...

TimeZoneInfo.ConvertTime equivalent for .NET 2.0?

I need to update a .NET 2.0 website to include a function to convert time from a time zone to another. Unfortunately I cannot use TimeZoneInfo.ConvertTime in .NET 2.0. Is there any equivalent or workaround that takes into account Daylight Savings time? Thanks in advance ...

Can the "dynamic" type vary safely in a generic collection<dynamic>?

Based on my answer to this question, I want to check something on my understanding of the upcoming dynamic type for C# 4. In this case, we have a collection that represents fields in a record pulled from an unknown database table. Older code (pre-.Net 4) requires such a collection hold items of type Object. Merits of a such a collecti...

Why can't you use null as a key for a Dictionary<bool?, string>?

Apparently, you cannot use a null for a key, even if your key is a nullable type. This code: var nullableBoolLabels = new System.Collections.Generic.Dictionary<bool?, string> { { true, "Yes" }, { false, "No" }, { null, "(n/a)" } }; ...results in this exception: Value cannot be null. Parameter name: key Descript...