.net

Most efficient way to ensure uniqueness of treeView property as user enters new values

Hi. I'm looking for an efficient little algorithm to traverse the text property of a .NET treeView node list. When the user is finished adding new nodes and eventually hits save I need to check that the text property (that contains the user entered friendly name) is still unique. Life would be easy if the treeView key happened to be thi...

Does anyone know of a WF sample that recreates the replicatoractivity

I would like to create a custom activity that loops through the Rows in a DataTable. ...

Non-Default Constructor

I have a component I created in C# which had previously been using the default constructor, but now I would like it to have its parent form create the object (in the designer), by passing a reference to itself. In other words, instead of the following in the designer.cs: this.componentInstance = new MyControls.MyComponent(); ...

FormatException 0 is not a valid value for Boolean

I am getting a formatexception with the following code. Any one know how to make BooleanConverter convert from 0/1 to true/false. bool bVal=true; string sVal = "0"; Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertFrom(sVal)); Thanks for the help! ...

.Net: DateRange cannot be converted to type 'Date

link text I'm having the same problem. My date format is MM/dd/yyyy. How do i find out the date format in my system and change it with code. ...

OpenId with Silverlight

What are your solutions? Has anyone successfully implemented OpenId with a Silverlight 2 app? OpenId requires a redirect to an outside site. I was looking forward to a slick Silverlighty login page for my app, but this isn't going to happen by the looks of things! ...

ASP.NET Membership Preventing People Logging in as the same user on different machines at the same time

One of the security requirements for my web based system is to prevent people logging in as the same user on different machines at the same time. E.g. to ensure that people cant all log in using the same password/share passwords. Is there a way to achieve this using the ASP.NET membership provider. Will I need to manually store info on...

When should I be using Odbc, OleDb, SQLClient? What are the trade-offs

I am starting off with a SQLServer database. So it would seem that I should use System.Data.SqlClient namespace. But, there is a chance that we might shut down our SqlServer database and go to MySql or Oracle. For this reason, I am coming up with a set of standards on how our .Net apps will communicate with the database, so as to make it...

.NET Roles and IIS7

Hello, In IIS7, I click on .NET Roles and I see a list of my Roles, but when I click a Role, no Users show up, the page is blank. I have added the users to the role and it does show the correct count next to the role name. Is these somehting I am missing? Does anyone else share this problem? Is this a bug? Thank for any help! ...

JavaScript and Jaws Screenreader

I'm embarking on a project where accessibility to WCAG 2.0 and the ability to use the web application in the JAWS screenreader are key requirements. I'm looking for insights as to how JAWS treats Javascript, is it a complete no go or is JAWS smart enough to cope!? ...

Escaping SQL queries - support for different Database platforms in .Net

Is there a .Net project/dll, that supports escaping of user supplied input to database queries for various database systems? I would like our entire team to standardize and use one module to perform escaping of user supplied input that will then be used in parameterized SQL queries. Ideally, I would like to specify the database system ...

How to programatically set or clear the 32BIT flag?

When compiling, I always set it for Any CPU. However there are some customers that do not have a 64 bit version of a required binary, even when running on an x64 system. In these instances I have asked them to modify my binary with the corflags.exe /32BIT+ option: http://msdn.microsoft.com/en-us/library/ms164699(VS.80).aspx I would lik...

Using ApplicationSettings to store Checked property for WinForms RadioButtons

I have a WinForms dialog box that contains 3 radio buttons. I am using ApplicationSettings to bind the Checked property of each of these RadioButton controls, but it doesn't do what I am expecting it to do. Now I have to click each radio button twice before it gets checked and the selected radio button is not being persisted. Is there a...

C#:: When to use events or a collection of objects derived from an event handling Interface?

I have what I think is a simple "problem" to which I have found a couple of solutions but I am not sure which way to go andn the best practice in C#. I have a master object (say a singleton) instanciated once during the lifespan of the application. This "MasterClass" creates a bunch of new type of objects, say "SlaveClass" every time Ma...

ConflictOptions.OverwriteChanges VS ConflictOptions.CompareAllValues

hi 1) If you are using ConflictOptions.OverwriteChanges, then you also need to set GridView.DataKeyNames, else GridView won’t pass these parameters to the SqlDataSource and thus the Delete operation won’t succeed. But if you’re using ConflictOptions.CompareAllValues, then DataKeyNames doesn’t have to be set. Why? 2) But why nee...

best collection object for FIFO and ability to view items by position

I'm looking for a collection object/strategy that can allow for FIFO and lets me view the items in the collection by simply specifying their position. To clarify: I would like this data structure to hold say 100 DTO objects, and then when it gets to 101, I can make room by deleting the first item, etc. (FIFO). I'd like to be able to r...

Changing the width of PropertyGrid left-side collection editor/view

Anything with a long string simply introduces an unusable view with a scrollbar.. Is the width on collection editor fixed by the-design and can a splitter be introduced to this awesome presentation? ...

How do I stop my System.Messaging.MessageQueue from wrapping my strings in XML?

I need to communicate with a legacy application from my C# app via the Windows Message Queue. The legacy application expects plain string messages in a particular private queue, but I can't seem to stop the System.Messaging.MessageQueue from wrapping my message in XML! The code I'm testing is very simple: MessageQueue myQueue = new Me...

rhino mocks with singleton

I'm using component from a third party. The component provide a singleton pattern for context into our application. I'm using on my side this singleton but I would like to mock this object for my test. Is there any way to accomplish a mock on this object. Also, the constructor is declared private. ...

Routing vs Url Rewrite (IIS7) Performance

I was wondering is there any difference in terms of performance between the two approaches? Any good articles on this? ...