.net-2.0

(DataGridView + Binding)How to color line depending of the object binded?

I would like to add a backcolor for specific line depending of a Property of the object binded. The solution I have (and it works) is to use the Event DataBindingComplete but I do not think it's the best solution. Here is the event: private void myGrid_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) ...

Strange Error - CS0012: The type x is defined in an assembly that is not referenced.

The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct(same) version. The rest of application has no issues except for one .aspx page. T...

virtual directories with different .net frameworks

Is it possible to have two virtual directories under the same website in IIS but have the virtual directories be using different versions of the .net framework? For example, under the default website, can I have one virtual directory targeting the 2.0 framework and a second virtual directory targeting the 1.1 framework? This is for IIS...

Invoke() is blocking

From time to time my applications GUI stops redrawing. There a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the event handlers play the InvokeRequired/Invoke game. Now I figured out that when the GUI fr...

How to test a remoting connection (check state)

I have an object created in a host application and can accecss it remotely using remoting, is there any way I can test the connection to ensure it is still "alive"? Maybe an event I can use that fires if the remoting connection gets disconnected, or some property that can tell me the state of the remoting connection. Is there something ...

Web service variable shared for the lifetime of the webservice?

How can I make a variable (object) available for the whole lifetime of the webservice? Static variable seem to work but is there an other way to do it? ...

Event Log SecurityException for Web Application?

I have an app that writes messages to the event log. The source I'm passing in to EventLog.WriteEntry does not exist, so the Framework tries to create the source by adding it to the registry. It works fine if the user is an Admin by I get the following whe the user is not an admin: "System.Security.SecurityException : Requested registry...

Controlling designer appearance of double-buffered owner-drawn UserControl in C#/.NET 2.0

I have an owner-drawn UserControl where I've implemented double-buffering. In order to get double-buffering to work without flicker, I have to override the OnPaintBackground event like so: protected override void OnPaintBackground(PaintEventArgs e) { // don't even have to do anything else } This works great at runtime. The probl...

Programming pattern using typed datasets in VS 2008

I'm currently doing the following to use typed datasets in vs2008: Right click on "app_code" add new dataset, name it tableDS. Open tableDS, right click, add "table adapter" In the wizard, choose a pre defined connection string, "use SQL statements" select * from tablename and next + next to finish. (I generate one table adapter fo...

Open a file for shared writing

The following code is just a simplified example to demonstrate my problem: using System; using System.IO; using System.Diagnostics; using System.Threading; namespace ConsoleApplication5 { class Program { static string LogFile = @"C:\test.log"; static void Main(string[] args) { for (int i = 0...

Enumerate .Net control's items generically (MenuStrip, ToolStrip, StatusStrip)

I've got some code that will generically get all Controls in a form and put them in a list. Here's some of the code: private List<Control> GetControlList(Form parentForm) { List<Control> controlList = new List<Control>(); AddControlsToList(parentForm.Controls, controlList); return con...

SQLMembershipProvider - source code

Where can I find the source code for SQLMembershipProvider (.NET2.0)? Is it available? ...

Is the .NET Framework usable on Win98?

I need to write a little tool for a customer to be run on Windows 98. Since this is a very small project I'd hope that I could avoid having to go native C++ and use C#. The .net Framework 2.0 download claims to support Windows 98. Are there any caveats or hitches to be aware of when installing or coding? ...

Custom namespace for code behind .aspx page

I am using .NET2.0. Let's say a have a simple aspx form with txtInput and btnSomeAction <asp:TextBox ID="txtInput" runat="server"></asp:TextBox> <asp:Button ID="btnSomeAction" runat="server" CommandName="SomeAction" Text="Do"/> Then within the code behind the form I have Protected Sub btnSomeAction_Click(ByVal sender As System....

VS 05 - Designer Attributes and Component Designer. How are they related?

I had this answer on another post I asked: "I believe the VS designer does it [components of a menustrip/statusstrip] by getting an instance of the control's designer (see the Designer attribute), and, if the designer is a ComponentDesigner, getting the AssociatedComponents property." How do I do this? I'm not even sure where to begin....

SAML with .NET 2.0

I've been given the task of working with SAML to implement an SSO solution between my company and a third party provider. My only issue is that I can't seem to find how to implement SAML in C# 2.0. I've been able to find a few examples for .Net 3.0 and 3.5, but none for 2.9 (and the classes they use don't appear to be available in 2.0)...

C# Generic and method

How can I select the good method (I have in the example below show 2 differents way that doesn't work). I was using instead of a variable of type Object with a IF and IS to do the job but I am trying to avoid using Object and boxing/unboxing. So I thought that Generic could do the job but I am stuck here. Here is a small snippet of cod...

.net 2.0 security configuration

Are there some help resources, or can anyone give me a brief Idea how I would configure the .net 2 runtime security policies for the following scenario: I have a windows forms control hosted in IE. The control tries to read from a serial port and write to the event log. Both of these operations fail due to security restrictions in the...

Vanishing scroll bar when using Autocomplete extender

Hi I use the Autocomplete extender feature to get the list of suggestions from my database. There is no scroll bar for this control, so I have added a scroll bar in a panel (MS .net 2.0) which i attach to my autocomplete extender.Now the issue is with the srcoll bar. like this <asp:Panel ID="autocompleteDropDownPanel" runat="server" ...

Call a webpage from c# in code

I need a way of calling a web page from inside my .net appliction. But i just want to send a request to the page and not worry about the response. As there are times when the response can take a while so i dont want it to hang the appliction. I have been trying in side the page_load event WebClient webC = new WebClient(); Uri newU...