.net-2.0

Referencing a web service project from unit testing project: project not in list

Problem: Trying to reference a .NET 2.0 web service project from my VS unit testing project. Right click on the References folder in the unit test project -> Add Reference. The .NET 2.0 web service is NOT listed in the listbox of projects available to reference. I know this usecase is possible; I have previously successfully reference...

.net 2.0 datagrid view combobox windows application

I have a data grid, a new row is added when i click on button. the new row consists of dropdowns in each cell. the value of the next cell dropdown must be based on the first cell drop down and so on for the third cell. I am using a .net 2.0 windows application in c# ...

How to find whether the .NET installed or not in the System by using c++??

Hi Is there any API available to find the whether the .NET framework installed or not in the system. or atlest can any one give me idea how to do this our own in c++ and also how to find the path where .NET installed if it is installed?? How can i do this ... Any Help in this regard will Be Appreciated Greately..... ...

Rendering HTML Content within Silverlight application

In one of our application it is required to display bullet list in one of the Silverlight 2.0 container. We have decided to use HTML markup text for the same. While there are number of options available on Google like overlaying HTML div container etc., I would like to know what is the most workable way of doing this. ...

searching a list object

I have a list: Dim list As New List(Of String) with the following items: 290-7-11 1255-7-12 222-7-11 290-7-13 What's an easy and fast way to search if duplicate of "first block" plus "-" plus "second block" is already in the list. Example the item 290-7 appears twice, 290-7-11 and 290-7-13. I am using .net 2.0 ...

BindingList and column flexibility

Everyone raves about BindingList in place of DataTable. How do you guys overcome the problem of column flexibility? For BindingList I need to define and implement T object. If any new columns needed to be added, I need to add new properties to T object....while in DataTable this is much easier. BindingList<T> samples = new BindingList...

Updating bound controls to ApplicationSettings

I'm attempting to utilize the .NET 2.0 ApplicationSettings feature for the first time, and find it a bit... puzzling in some ways. I'm hoping someone can help me figure out where i'm going wrong. I have a generic settings class which i've implemented that is a subclass of ApplicationSettingsBase. I've implemented a property, and tagge...

How to use my CustomControl with javascript inside a gridview inside an update panel ?

Hi, I got trouble when I want to add my custom control with an gridview and an updatePanel. The javascript function is never added to the page even if I write it directly inside the RenderContent method. The page is : UpdatePanel GridView EditItem CustomControl ...

How to approach refactoring a class? (VB.Net)

I recently started a project and needed to do some integration with LDAP via DirectoryServices. I've done this in other apps so I went into one of them to see how I did it -- why reinvent the wheel right? Well, while this wheel works, it was developed years ago and kinda smells (it's wooden, firmly attached to the previous vehicle, har...

What Determines the Encoding used in Xml Serialization?

I'm currently serializing an object using XMLSerializer, and the resulting XML starts with: <?xml version="1.0" encoding="utf-16"?> Which I would like to get rid of, because in this particular case I don't need it (I'll only use the serialized string to deserialize later with my own code, so I can re-add it later when needed). I'm al...

C# Efficient Substring with many inputs

Assuming I do not want to use external libraries or more than a dozen or so extra lines of code (i.e. clear code, not code golf code), can I do better than string.Contains to handle a collection of input strings and a collection of keywords to check for? Obviously one can use objString.Contains(objString2) to do a simple substring check...

Is there a set type in .NET 2.0?

Possible Duplicate: Is there a Set data structure in .Net? Duplicate: this is a duplicate of "Is there a “Set” data structure in .Net?". Please close it as a duplicate and address any further answers to the earlier question. Is there a generic collection analogous to the STL set<T> template in the .NET framework? If not, how w...

Binding a property to another property

Hi everyone, I have nested groupboxes, which logically represent nested data structures in my application. Let's say i have a structure like this: Dev1 - CDev1 - CDev2 - ICDev1 - ICDev2 I have checkboxes to enable/disable each of these Devs. I want to bind the CheckState of the child checkboxes to the parent checkbox'...

C# - Can I Data Bind between a value and an expression?

Hi, I have a List and a Button. When the Lists Count == 0, I would like the button Visibility to = false. How do I do this using Data Binding? Thanks in advance, Added I have asked this so that I can try to avoid checking the Count on the list in code every time I add or remove an item to or from the list. But if there is no solution...

Implementing conditional in a fluent interface

I've been trying to implement a fluent interface for a set of rules in my system. What I am trying to accomplish is this TicketRules .RequireValidation() .When(quartType => quartType == QuartType.Before).TotalMilageIs(64) .When(quartType => quartType == QuartType.After).TotalMilageIs(128); However, I have trouble implementing the When...

Most efficient way to jump through a file and read lines?

I want to use a FileStream and seek from the beginning of the file while moving forward in the file .01% of the file size at a time. So I want to seek to a position in the file, read the entire line, if it matches my criteria I am done. If not, I seek ahead another .01. C# is OK but VB.NET preferred. I used to do it something like thi...

C# absolute min date

For political correctness, I would like to know if there is a way to instantiate a date so that it contains the lowest date value possible in c# net v2. ...

Why could I be getting error "The underlying connection was closed" when getting an Image?

I'm using a little code to grab an image given its URL, and it's working for me for all URLs I tried except one: http://title.mximg.com/img/logo/bizrealty.com.gif For this URL, I'm getting "The underlying connection was closed: An unexpected error occurred on a receive." However, if you open that URL with a browser, it loads perfectl...

Ways to speed up build time? (C#/Unmanaged C++)

A legacy app I am working on currenty takes ~2hours to build. The project has about 170 projects with 150 or so being unmanaged C++ and the other 30 C#.Net 2.0. What are some suggestions on ways to improve build times for something like this? ...

Winforms Texbox Lines per page

Hi, We have a number of multiline, scrollable winforms texbox controls in .net 2.0 that need to implement pagination in order to allow the user to navigate their contents only by moving a single page (a full control's worth of text) at a time. As part of this I need to get the number of full lines of text that can be visible on screen ...