.net-2.0

Developers who have experience of .NET 3.0 or greater, what features would you recommend to look at first ?

There are quite a few features a .NET developer needs to brush up on to get up to speed. I am still on 2.0, probably becuase of the industry I work in, where Banks tend to hold back on using bleeding edge technologies (in my experience). Developers who have experience of .NET 3.0 or greater, what features (both language and framework...

My SQLParameter isn't passing NULL correctly.

I have this C# webform that has has a date picker box. If the date is set to nothing (the default) I want it to pass NULL to the database. This happens inside my parametrized query. SqlParameter CMActionDate = new SqlParameter(); CMActionDate.ParameterName = "@ActionDate"; if (ActionDate.Equals("")) { CMActionDate.Value = Syste...

Recommended .NET app installer?

I need to create an install for my app that executes the following actions: Copies files Writes registry settings Registers a windows service Writes an XML app.config file (based on user supplied info during install--a connection string) Executes SQL scripts against a remote database (connection info obtained in #4) Installs and regist...

WebForm_SaveScrollPositionSubmit is undefined - ASP.NET

I'm upgrading an ASP.NET 1.1 app and have things working but am seeing the Javascript error referenced in the title. From research it appears that ASP.NET is not spitting out the javascript that is used to maintain scroll position between postbacks. I did some googling and have checked the various issues mentioned but can't seem to fin...

How can I check if the current operation is in the scope of an object?

Similar to how database connections made within the scope of a TransactionScope will behave accordingly, I want to be able to test inside my class whether it is within an instance of another class? My Scenario I have a class (EntityBase) that all database objects are built upon, and has methods such as AddToDatabase, UpdateInDatabase, ...

Change Color of Button in DataGridView Cell

I have a large DataGridView control that has several cells most of which contain a button. How can I change the color of those buttons? This changes the "outline" of the button but not the button itself. row.Cells[2].Style.BackColor = System.Drawing.Color.Red; This doesn't seem to change anything that's visible: row.Cells[2].Style....

How to make my Windows Form app snap to screen edges?

Anyone out there know how to make your .net windows form app sticky/snappy like Winamp so it snaps to the edges of the screen? The target framework would be .NET 2.0 Windows Form written in C#, using VS08. I am looking to add this functionality to a custom user control, but I figured more people would benefit from having it described f...

Network performance measurement in asp.net 2.0 via HttpHandlers and HttpModules strangeness

We have a performance measurement module that relies on HttpModule and HttpHandlers and works like this: Request comes in to server for a page. HttpModule_Begin writes start time in the cookie. HttpModule_End writes end time in the cookie. On client, when page load is finished, fire off a special request via AJAX that is handled by Htt...

Access the same running code from a Windows Service and a console application?

I have an application that is built as a Windows Service and a c# library assembly (.dll.) In order to manage and maintain this service, I'd like to add the ability to run a command-line application that tells the last time the service archived files, the next time it's scheduled to do so, the status of the last run, and the location of ...

Quick way to return a list of custom objects from a page method w/o a separate BLL

I am using jQuery to retrieve a JSON object from a page method. I have a DAL which uses SubSonic and if I return objects created from SubSonic-generated classes I will clog up the pipes. :) You know, all public properties get serialized. I don't want a separate business layer for this application, because it's small and focused on read o...

How do i make sure that List<T>.Contains(T) works with my custom class?

I use .net 2.0 (C#) I have a Person class, and i pupulate List< Person> p from the database. i know for a fact that my list has duplicates, but when i try to remove the duplicates they don't get removed. Does my Person class need to implement any interfaces for List< T>.Contains(T) to work properly? Any other ideas? Thank you. ...

Automatically Refresh a web user control

How can we refresh a web user control automatically without a page postback in asp.net 2.0? i have tried meta tags in controls head tag but it also refreshes the whole page. ...

How do you specify to pass a Type that is of a specific interface?

I have a method where I want to have a parameter that is a Type, but of a certain interface. E.g.: public static ConvertFile(Type fileType) where I can specify fileType inherits IFileConvert. Is this possible? ...

How to design a inherited collection

I'm writing a program in C# that has a custom collection. The custom collection performs some useful aggregate functions (AllSuccessful, %Successful, etc) over it's members which are of type ResultInfo. I have several classes that derive from ResultInfo (UploadResultInfo, XUploadResultInfo, and YUploadResultInfo), and would like to hav...

What is the 'page lifecycle' of an ASP.NET WebForm?

I'm looking to get a more thorough understanding of the ASP.NET page lifecycle. I'm in the process of building custom form controls and have found my knowledge in this area to be lacking. Are there any resources, tutorials, etc. that you've used to better understand this area? Are there any tools you've used to improve your knowledge i...

asmx .net 2.0 web service

i created a web service, upload it to my site on a remote server. i tried to browse it but i cant, i also tried to add web reference to his adress through vs08 but the same problem happened there. ...

Changing ListBox selection is not moving changes from BindingSource to DataSet.

The answer to this question may turn out to be, "Don't use typed DataSets without using the Binding Navigator." I am curious, however, about the behavior I'm seeing. So, I created a form where every control was dragged from the data sources explorer. I deleted the Binding Navigator because it is ugly and inappropriate for this particula...

Problem with batch update using DataAdapter

I am updating the sql server 2005 database using batch update, as shown below cmd = new SqlCommand("update Table1 set column1 = @column1 where EmpNo = @EmpNo", con); cmd.Parameters.Add(new SqlParameter("@column1", SqlDbType.VarChar)); cmd.Parameters["@column1"].SourceVersion = DataRowVersion.Current; ...

Use of Global.asax in distributed approach ie Web garden

I understand the limitations of using application state and session state accross multiple application pools, that they cannot be shared. What about the Global.asax file is a single instace created per application pool or does it reside in a higher level somewhere common to all application pools in IIS? ...

Image orientation in a GridView Control

I'm hoping someone can help me with a question I have about images and GridView controls in ASP.Net 2.0. I'm trying to put together a photo album application as a learning exercise which uses a GridView control with two columns. Column one will display the image (using an image column type) based on a URL held in the database I am using...