.net

Public getter, protected setter with CodeDOM

Is it possible to generate a property with a public getter and a protected setter with CodeDOM? The goal is to achieve something similar to the following. [Serializable] public class Wrapper { public Wrapper() { } private string _Field; public string Field { get; protected set; } } I have a large COM based API for which I wish t...

derived class custom serialization

I have class A which has custom serialization implemented And i have class B,C & D derived from class A, It is required to implement ISerializable on derived class as base has implemented custom serialization. Is it something i must implement? or am i missing some piece of technology that can let me use default serialization using [ser...

Difference between "\n" and Environment.NewLine

What is the difference between two if any (with respect to .net)? Thanks ...

Fluent methods library for C#

Where can I find a library with collections of fluent methods as in Rails I found some here ...

Visual Studio Recent Project list

Hi there, In the start page in VS2008 or any version for that matter is there a way i can get rid of the "Getting Started" and "Visual Studio Headlines" list and have the "Recent Projects" list extend all the way down to the bottom so I can see the last 30 or so projects I have used? ...

Twitter update_profile_image in C#

I am having trouble implementing Twitter's [update profile image] method. Does anyone have any sample code for passing an image as raw multiart data to the Twitter API? I am using .NET. ...

How can I do Time based / scheduled events in .NET ?

Hi folks, I need to offer scheduling of actions/events, in our web site. A crap analogy could be a calendar system, where a person adds a calendar item and when the date/time has been 'hit', then some logic (eg calculate a report) is fired. I could be having hundreds and even thousands of scheduled events that are entered by my clients...

Extension methods defined on value types cannot be used to create delegates - Why not?

Extension methods can be assigned to delegates that match their usage on an object, like this: static class FunnyExtension { public static string Double(this string str) { return str + str; } public static int Double(this int num) { return num + num; } } Func<string> aaMaker = "a".Double; Func<string, string> doubler = FunnyExtensio...

standalone database

Hi, I'm currently designing a small application in .Net and in the past I've been using MSAccess as standalone database that I can ship with the program. But I was wondering if in this day and age there wasn't alternative solutions, as easy to integrate in a .Net app., as transparent for the user and maybe better performance with large...

SQL Server as a Web Serivce Client

Suppose given a URL, http://test.org/service.asmx How can I use SOAP method in SQL Server to access the service? ...

.NET 3.5 optimizations after converting from 2.0 to 3.5

I converted our project from .NET 2.0 to 3.5 and am looking for optimizations that can be done utilizing 3.5 framework. What are some of the things I can do with 3.5 as in Datastructures. Also any suggestions in using DataAccess apart from LINQ to SQL. Any suggestions/pointers would be great. I am not looking at any specific optimization...

Recycling Options for ASP.Net Application State Object

What are the options for recycling the ASP.Net application state object? I'm using that object to store queues of database connections for a web serviced based data access layer. I'm concerned that over days/weeks/months I'll end up allocating growing sums of memory on connections to db's that are no longer in use. The connections are...

How to determine if the current Windows session is locked or not?

I have an application which runs every hour on a Windows XP Machine. To run properly, this application requires the current session to be unlocked. So I was wondering if there a way to know if the current Windows session is locked or not with C# and .NET 3.5. UPDATE: The application cannot listen to the SessionNotification events. The a...

Error creating a proxy from wsdl

I am using a .net 2.0 client to create a proxy from a wsdl file. This wsdl has some types included from other xsd files. When I create proxy, the types that are specified in xsd documents are created even though they are referenced with in the wsdl. I tried it some other clients like Soap UI, java. They all work fine. Is there a tweak t...

Regular expression for validating a url

Hi, I'm a beginner in regexes. My requirement is to validate simple urls to urls with query strings, square brackets etc.. say for eg, www.test.com?waa=[sample data] the regex that I wrote only work for simple urls. It fails for the one with square brackets. Any idea? ...

C#: Regasm generating registry entries for every class in my COM DLL?

Hey everyone, I'm writing a class-library (IE BHO) in C# and currently wrangling with the large volume of what I think is junk output coming from REGASM's generated registry keys. The short version is this: I only want to expose a handful of classes (currently: ONE class) to IE (and the rest of COM). Only one class has the ClassInterf...

find out the property name within IUserType.NullSafeGet

Is it possible to find out the property name of the current column within the IUserType.NullSafeGet function? The string[] names parameter of the IUserType.NullSafeGet function does only provide the aliases of the field that was used for the query. But in order to get a list of attributes that are attached to the owners (object owner of...

What is diff Between Ref And Out??

Possible Duplicate: Whats the difference between the 'ref' and 'out' keywords? What is the difference between ref and out? I am confused about when to use ref and out. So please explain how to use ref and out, and in which situations. ...

Restrict Textarea for not accepting 250 character.

Dear All, I have a textarea in C#, please see below code: <asp:Label ID="lblQuestions" runat="server" CssClass="addinfo"> Question & Comments</asp:Label> <asp:TextBox ID="txtQuestions" Rows="5" Columns="5" TextMode="MultiLine" runat="server" MaxLength="250"></asp:TextBox> Now I want that textarea should not accept...

How to improve the Performance of FtpWebRequest?

I have an application written in .NET 3.5 that uses FTP to upload/download files from a server. The app works fine but there are performance issues: It takes a lot of time to make connection to the FTP server. The FTP server is on a different network and has Windows 2003 Server (IIS FTP). When multiple files are queued for upload, the ...