Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
all groups > c# > april 2008 > threads for friday april 4

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Generics and comparison (follow on from my previous "Generics and collections" thread)
Posted by Martin Robins at 4/4/2008 5:53:12 PM
Marc has sorted my problem with the collections, however I am now in a = new scenario; I am trying to compare a generic property value before = setting it as shown below ... public T Value { get { return this.value; } set { if ( this.value !=3D value ) { ...more >>


fonts
Posted by Analizer1 at 4/4/2008 5:38:39 PM
How to set Fonts to muliple Styles for instance Font oFont = new Font("Arial",10,FontStyle.bold) //id like to use bold + Italic how is this done...i keep getting errors.. thanks ...more >>

ReaderWriterLockSlim + Dispose?
Posted by NvrBst at 4/4/2008 4:33:09 PM
One last question today :) Most locks I've used never had a Dispose (Monitor, ReaderWriterLock, etc). Looking at the ReaderWriterLockSlim's Dispose method its just cleaning up some Threading.WaitHandle's. Whenever I see a Dispose method I always want to call it after I'm done with the objec...more >>

datasets
Posted by Goon at 4/4/2008 4:16:35 PM
I have a dataset with two datatables, each from different datasources. The two tables are related by a datarelation. How would I databind a gridview to something equal to "SELECT * FROM table1 JOIN table2.." ...more >>

Code Analysis - CA1816 (CallGCSuppressFinalize)
Posted by NvrBst at 4/4/2008 4:04:37 PM
Code Analysis always returns the following message on a bunch of my classes. Warning 75 CA1816 : Microsoft.Usage : Change 'xxx.Dispose()' to call 'GC.SuppressFinalize(object)'. This will prevent unnecessary finalization of the object once it has been disposed and it has fallen out of scope. ...more >>

Selectively change the color of an Item in a listbox
Posted by CSharper at 4/4/2008 2:47:24 PM
Is it possible to selectivly change the color of an item in text. I saw ForeColor option, but it changes the color of all the items. If it is not possible, is there any other control list listbox where we can see more than one item and change the color during run time. Thanks....more >>

Generics and collections
Posted by Martin Robins at 4/4/2008 2:32:48 PM
I do not know if what I am trying to do is impossible, however since I = cannot work out how to do it I thought I would post it here in the hope = of some assistance. Consider the following code ... using System; public class Parameter<T> { private T value; p...more >>

Starting a program from code
Posted by Dom at 4/4/2008 2:12:12 PM
I want to give the users a button that they can click to start up a google search with text from a text box. How do I start IE from code. I assume I can easily get IE to go to Google with a search string. ...more >>



try-catch question
Posted by Dom at 4/4/2008 2:08:14 PM
I'vw decided to use a try-catch setup, because of a recurring bug. I started off with just catch (SqlException), and that worked, so I got fancier and added a catch (Exception) after it. Now the last catch is always caught. Here is a good snippet of the code. The "m_xxx" variables are all ...more >>

SafeFileHandle Without a File?
Posted by NvrBst at 4/4/2008 2:06:18 PM
Just for clarification, the Microsoft.Win32.SafeHandles.SafeFileHandle can be used with anything that uses the "kernel32's CloseHandle" method for clean up? For Example, "kernal32's OpenProcess"? It seems to work, but I just wanted to be 100% sure. NB...more >>

Retrieving initializeData attribute from TextWriterTraceListener
Posted by Debbie.Croft@nospamforme.com at 4/4/2008 12:58:21 PM
I set up a TextWriterTraceListener in the App.config file. I'd like to be able to tell, programmatically, which file it's using. However, I don't seem to be able to get at the initializeData attribute. The Attribute collection attached to the TextWriterTraceListener is empty. Any ideas as t...more >>

Upgrading a visual studio 2005 solution to a visual studio 2008 solution
Posted by Andy B at 4/4/2008 11:40:32 AM
Is there anything special you have to do to upgrade or transfer a vs2005 solution to a vs2008 solution? Or do you just open it in vs2008 and follow some directions? ...more >>

Stopping log file created by TextWriterTraceListener getting too big?
Posted by Debbie.Croft@nospamforme.com at 4/4/2008 11:30:06 AM
Does the TextWriterTraceListener class keep the log file it's responsible for to a manageable size, or will it grow it until the system crashes with a full disk? If the latter, what's the best way to maintain the log file? ...more >>

Object initializer question
Posted by CSharper at 4/4/2008 10:36:08 AM
I am creating a MVC pattern code for my project and here is what I am doing in the view constructor presenter = new presenter(){name = "MVC", view = this, age=30}; and int the presnter I have public variables for name, age and declared the view as interface to interact with the view. ...more >>

Reflection : GetEvent, GetMethod, Bind Method on Event
Posted by Claude at 4/4/2008 10:35:01 AM
TValue oItem = (TValue)Activator.CreateInstance(typeof(TValue), BindingFlags.Instance | BindingFlags.NonPublic, null, new object[] { m_nCleTemporaire }, System.Globalization.Cultu...more >>

I wished I had a way to error on unused return value for a type
Posted by not_a_commie at 4/4/2008 10:11:43 AM
Some of my classes are immutable. Calling any function on one of those classes without using its return value is an error. I wished I could declare this as an attribute of the function itself that would then cause a compiler error if that return value was not used. Has anybody else had this need...more >>

System.Timers.Timer Issue
Posted by Matt at 4/4/2008 10:08:49 AM
I have a windows service that is using the timer object from System.Timers to fire every minute and do some work. Occasionally that work takes longer than a minute - and I don't want the elapsed event to fire again if a previous event is still occurring. In the elapsed event the first thing t...more >>

Beginner and trying to get the tag value of a treeview.selectednod
Posted by KCBTDev at 4/4/2008 9:55:02 AM
I am trying to do this line of code: txtBxMessageBody.Text = ".\\ " + treeView1.SelectedNode.Tag.ToString(); I am getting an error back. It is something pretty simple but I can't figure it out. The error is: System.NullReferenceException: Object reference not set to an instance of an obje...more >>

Various newbie questions on C#
Posted by COHENMARVIN@lycos.com at 4/4/2008 9:08:07 AM
I am used to using Visual Basic, and I am now trying out Visual C# 2008 express. One thing I don't know is how to make a dialog box disappear. In VB, you could say "Unload Me" or "Me.Hide" But I can't find anything like this with C# forms. Another thing I tried to do was put a textbox on ...more >>

What is the suitable Network Architecture?
Posted by Varuna at 4/4/2008 8:52:00 AM
I have to design a system as an assignment.It is comprised of several branches and a head office.My point is since these branches and the headoffice belongs to the same company what is the suitable network architecture, should it be a Web based or networked using lease lines.What is the sui...more >>

Urgent:How to Check availability of web service
Posted by nRk at 4/4/2008 8:26:53 AM
Hi, Is there any way to check the availability of a web service without including any extra web method? Thank & regards nRk...more >>

yield question
Posted by CSharper at 4/4/2008 8:14:29 AM
I have the following code ArrayList list = new ArrayList(); foreach (string name in FilesNames()) { list.Add(name); } return list.ToArray(); which basically calls FileNames() method which yeild a string for each call. It works file. The objective of this method to return an object[...more >>

why do extension functions ignore the where clause?
Posted by not_a_commie at 4/4/2008 8:09:02 AM
I have here some example code (below) that I believe should work fine. However, I get the error Error 1 The call is ambiguous between the following methods or properties: 'TestExtensions.ExtensionsOne.AddFive<TestExtensions.One>(TestExtensions.One)' and 'TestExtensions.ExtensionsTwo.AddFive<...more >>

How to dynamically create generic type from other
Posted by Jon Slaughter at 4/4/2008 7:32:07 AM
I have some code like if (val.GetType().Name == typeof(List<>).Name) { } which lets me determine if val is a generic list(I've already taken care of the non-generic part but I'd rather be able to compare them like if (val is List<>) but this obviously doesn't work. (and I can't code it...more >>

Timer not working in thread
Posted by sony.m.2007@googlemail.com at 4/4/2008 6:11:43 AM
Hi, My application processes a file and updates the data into sql server. The process takes around 30-90 seconds.I decided to put a timer to display the user a label(making label visible false and true) with message like "processing..." and do the other process using thread. The timer won't wor...more >>

Error in C# Single Quote
Posted by Saimvp at 4/4/2008 3:22:08 AM
Hello. I have a problem about single quote search in C#. I have 1 table: ID NAME COMPANY 1 Sayre One 1' Sayre Two In search button if I will input 1 textbox1.text.replace("'","") the output is: ID NAME COMPANY 1 Sayre One if I will inp...more >>

XML question on elements, child and children of childs...
Posted by SharpieNewbie at 4/4/2008 12:30:07 AM
Hi all.. i have a newbie question that i cant find a good reference online or in some of the books i've seen.. If i have a XML file that i've created, that looks something like this: <Movies> <Movie> <Title>Lord Of The Rings</Title> <Cast> <Actor>Orlando Bloom</Actor> <Actor>Sean...more >>


DevelopmentNow Blog