.net-2.0

MonthCalendar control selection range with EnableVisualStyles?

I'm using the MonthCalendar control and want to programmatically select a date range. When I do so the control doesn't paint properly if Application.EnableVisualStyles() has been called. This is a known issue according to MSDN. Using the MonthCalendar with visual styles enabled will cause a selection range for the MonthCalendar ...

GUI For Service Methods

We have a service that runs methods used for data import/export at specified intervals. To test these methods we have a little application with a single button that, when clicked, instantiates the import/export class and invokes the desired method. Nothing fancy. I would like create a more robust test application that can receive debu...

Nunit.exe cannot work on Vista 64bits if x86 build

I am on Vista 64 bits and I have a project built with x86 configuration. All work fine. Now, we are at the time to create test. We have NUnit 2.4.8 but we have a lot of problem. The test are loading trough the Nunit.exe (gui) when we select the .dll directly but when executing we have a system.badimageformatexception. I have read by se...

.Net 2.0 ServiceController.GetServices()

I've got a website that has windows authentication enable on it. From a page in the website, the users have the ability to start a service that does some stuff with the database. It works fine for me to start the service because I'm a local admin on the server. But I just had a user test it and they can't get the service started. My qu...

View need to go Winform to Webform, what is your advices?

Hi, Our application is well structured (well we did our best!) and we have split the Model from the View, Now, we need to let some information to our client with a web access. We would like to build something small with IIS and some webform. Here some information you might think are useful: Our controller have Thread of database quer...

Exact time between 2 DateTime?

I would like to know many minutes between 2 dates? Example : Now - tommorow at the exact time would return me 1440. ...

Assembly "is not signed correctly." Warning

I have a mobile .NET solution and decided to sign the assemblies. Compilation completes without errors but gives the warning 'CompactUI.Business.PocketPC.asmmeta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not signed correctly. The application is working fine but I can't open the designer for forms using this assembly an...

ICollection, readonly collections, and synchronisation. Is this right?

I have a custom class that implements ICollection, and this class is readonly, ie. IsReadOnly returns true (as opposed to using the readonly keyword), and all functions that would normally modify the data in the collection throw InvalidOperationException's. Now, given such a construct, and a quick skim over the thread-safety issues when...

Reading from file not fast enough, how would I speed it up?

This is the way I read file: public static string readFile(string path) { StringBuilder stringFromFile = new StringBuilder(); StreamReader SR; string S; SR = File.OpenText(path); S = SR.ReadLine(); while (S != null) { stringFromFile.Append(SR.ReadLine()); ...

How force a maximum string length in a C# web service object property?

In this class for example, I want to force a limit of characters the first/last name can allow. public class Person { public string FirstName { get; set; } public string LastName { get; set; } } Is there a way to force the string limit restriction for the first or last name, so when the client serializes this before sending ...

I can swear i once did " new Literal("<b>hello there</b>");

I could have sworn i have done this somewhere - im using 2.0 right now - was this something i found in a later version? IE: pass the content of a Literal in the constructor I remember myself saying 'huh, and all this time i created a new instance and then set the text property' - or did I go to sleep drunk that night? And if not, WHY ...

C# : Characters do not display well when in Console, why?

The picture below explains all: The variable textInput comes from File.ReadAllText(path); and characters like : ' é è ... do not display. When I run my UnitTest, all is fine! I see them... Why? ...

Graphs on Windows Forms using C# (.NET 2.0)

Is there an Open Source Free Graph Control for Windows Forms .NET 2.0? ...

How do I get the contents of an XML element using a XmlSerializer?

I have an XML reader on this XML string: <?xml version="1.0" encoding="UTF-8" ?> <story id="1224488641nL21535800" date="20 Oct 2008" time="07:44"> <title>PRESS DIGEST - PORTUGAL - Oct 20</title> <text> <p> LISBON, Oct 20 (Reuters) - Following are some of the main stories in Portuguese newspapers on Monday. Reuters has not verified t...

Printing with the System.WIndows.Forms.WebBrowser control

I'm using th WebBrowser control in the .net 2.0 framework. Is it possible to change the printing behavior so it always prints to the default printer, without showing any dialog to the user? This is for a kiosk so there will always be a printer directly connected to the Kiosk, and printing should be seemless to the user. ...

How can tooltips be added to a vb.net winforms datagrid row(s)?

I'm looking to add a tooltip to each row in a bound datagrid in vb.net winforms. How can this be done? ...

C# class from a SQL database table.

Came across this: http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp And wondering if this is the right solution as I am not that big of a fan of creating a class for every stored procedure or do I use Enterprise Library for ASP.net 2.0 project. ...

"CLR detected an invalid program." when calling Generic Methods

I write a large static method that takes a generic as a parameter argument. I call this method, and the framework throws a System.InvalidProgramException. This exception is thrown even before the first line of the method is executed. I can create a static class which takes the generic argument, and then make this a method of the static ...

"Thread was being aborted" exception whilst displaying dialog

In my app I've got a thread which displays for some time "please wait" dialog window, sometimes it is a very tiny amout of time and there is some glitch while drawing UI (I guess). I get the exception "Thread was being aborted" and completly have no idea how get rid of it. I mean Catch that exception in some way, or in some other way hi...

How should I manage developing on SQL Server 2008 and SQL Server 2005 for different clients?

The company I work for has several clients. I'm currently splitting my time between 2 .net projects. For Client A I need Visual Studio 2008, SQL Server 2008 and the 3.5 framework. For Client B 2005 versions/2.0 Framework. Others in the company are using Microsoft Virtual PC to keep the development environments separate. What do you su...