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# > january 2006 > threads for wednesday january 25

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 31

Static Methods
Posted by Mr. Bean at 1/25/2006 10:55:33 PM
I building a small win application that has one form and several classes. I want to allow each class to give a log about its activities, so I created a static method at the form and called it from each class. ex Form1.echo("the message"); //in the form staic void echo(string x){ log_tb.Text ...more >>

Can we set User.Identity by program
Posted by ad at 1/25/2006 10:33:32 PM
The User.Identity of WebPages is set with login controls in asp.net 2.0. Can we set the User.Identity with program not by Login Controls? I have tried the code: this.User.Identity="Jhon", but it fail when compile. ...more >>

Operator== overload problem
Posted by Tony at 1/25/2006 8:44:38 PM
I have an operator== overload that compares two items and returns a new class as the result of the comparison (instead of the normal bool) I then get an ambiguous operater compile error when I attempt to check to see if the object is null: "The call is ambiguous between the following methods...more >>

Change Value in ArrayList
Posted by wg at 1/25/2006 8:43:51 PM
I have written a class to contain tags that are loaded from a spreadsheet. I can load the value ok. But from another class I would like to change a value inside the arraylist. Here is my code (see Update). Thanks wg class Singleton { private static Singleton instance; // Lock s...more >>

Strategy to Refresh Multiple Forms Simultaneously
Posted by Jeff at 1/25/2006 8:42:41 PM
I plan to write a Windows Forms MDI application for a medical office. Users must be able to select a patient and view related information on multiple forms; with1-4 forms opened at the same time for the same patient; each form showing a different type of patient-related information. After v...more >>

Bug in NET v2.0 AfterCheck event
Posted by Mike B at 1/25/2006 8:13:02 PM
I am experiencing what looks to be a bug using the AfterCheck event. I have a TreeView which represents a hard disk directory structure. When a tree node is expanded or collapsed, the AfterCheck event is being fired. From my undesrtanding, this event should only be occuring when a node is c...more >>

Question re Visual Inheritance in VS 2005
Posted by Dino Buljubasic at 1/25/2006 8:10:45 PM
Hi, I am thinking of using visual inheritance. I am using C# VS 2005. I am concerned about how good it is. I have heard about problems like controls dissapearing or so. Any hints, tips, ideas, concerns ??? Thank you, _dino_...more >>

FileStream Speed issue
Posted by TheMadHatter at 1/25/2006 8:04:01 PM
Yello, Quick Q: What is the fastest way of getting data from a file? Does the though put of the file increase if I collect a great big chunk of it? Eg say 6meg? or does that even help? Does a bufferedstream work better if I am just going to open a file and read it? All I am doing, is o...more >>



append to query string
Posted by netnet at 1/25/2006 8:00:04 PM
Hi, I have an asp.net page that has a save method. I would like to append to the querystring at the end of the save method, before the page reloads. Is there a way to do this without using Server.Transfer? Thanks Sean ...more >>

Are templates usefull?
Posted by luke at 1/25/2006 7:12:39 PM
Are they? I mean, you could always downcast them for particular use, but then the system would be well designed with intefaces instead of generics, and for other uses I don't see any sense (collections excluded). Why do I need to hold something of type 'object'? For what concrete usage? I am ...more >>

Serializing Multiple Objects of a Class
Posted by Ahmad Jalil Qarshi at 1/25/2006 6:17:50 PM
Hi! I have a class named CClassToSerialize that contain some boolean, string and few custom variable types. Now when I create only a single Object and Serialize/Deserialize everything is fine. But I want to save more than one Object of this class into same file. Now the problem is th...more >>

Any safe way to do this?
Posted by Joe at 1/25/2006 6:01:54 PM
I need to some how add a page to a tabcontrol. The problem is I have a single method to bring up the dialog which contains the tabcontrol and doesn't return until the dialog is closed and I don't have any events for it. The only thing I can think of is to start a thread before calling that ...more >>

physics engine
Posted by Joan Parera at 1/25/2006 5:56:42 PM
Hello everybody, I have been searching around the net for a good (commercial or non-commercial) physics engine written in C#. Unfortunately I only know the existence of many physics engine (novodex, ageia, etc.) but they are written in c++. Does anybody know/has any notice/has heard of any w...more >>

Opening Word 2000 File
Posted by Kevin at 1/25/2006 4:37:37 PM
Hi I've this code to open a Word 2000, but this generate an error. I reference to Microsoft Word 9.0 Object Library. WordApp = new Word.ApplicationClass(); if(WordApp != null) { WordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone; WordDoc = WordApp.Documents.Open(ref DocFile, ref FalseP...more >>

export datagrid to Excel
Posted by Frank at 1/25/2006 4:06:46 PM
Hello All, I ham using VS.NET 2003. Have followed instructions from http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several other articles to no avail. I am pulling my hair out at this point. What I have is this : Members.aspx file: <HTML> <HEAD> <title>member...more >>

Arraylist of Arraylist
Posted by Iapain at 1/25/2006 3:22:32 PM
Hello, I've created an arraylist which consist arraylist ..like ArrayList myAL = new ArrayList(); // Main Array List ArrayList tmpAL = new ArrayList(); //Temp Array List tmpAL.Add(2); //Add int to Temp AL tmpAL.Add(3); //Add int to Temp AL myAL.Add(tmpAL); //Add Temp AL to Main AL //(and ...more >>

ASP.NET 1.1 HttpContext.Session question
Posted by Hardy Wang at 1/25/2006 3:22:26 PM
Hi, I have a web application, code of ASPX page needs to call one static method in another class which does not inherit System.UI.Page class using System.Web; public class Utils { public static void GetSessions() { HttpContext ctx = HttpContext.Current; ctx.Sessio...more >>

How to obtain the current users Temp folder
Posted by James at 1/25/2006 3:03:40 PM
How to obtain the current users Temp folder %temp% using C# ?? Thanks in advance JIM ...more >>

Constructing simple XML?
Posted by Brett Romero at 1/25/2006 2:03:19 PM
What is the best way to construct this type of XML <ROOT><Person PersonId=\"1000\" /><Person PersonId=\"1001\" /><Person PersonId=\"1002\" /></ROOT> when I'm getting back only the three numerical values? The is occuring in a loop and I'm getting a variable such as PersonID, which holds the ...more >>

How to use [STAThread] in web application?
Posted by anadimpa at 1/25/2006 1:59:02 PM
Hello, I am using a COM object which requires the use of Single Thread Apt.. I have used this before in Windows/Console applications which have the Main[] methods [STAThread] static void Main(string[] args).... How can I use this in a regular web page? thanks -- adi...more >>

Setting up a webserver
Posted by Mailserver From Hell at 1/25/2006 1:43:56 PM
How do I configure my WIN2003 SBS server to allow me to use it to develop WebServices? I am trying to use VS Enterprise Developer version 2003. on my Win2K box and create projects on my 2003 server. I keep getting an error trying to save the project on the server. ...more >>

How to convert C# source to CodeDom graph?
Posted by Alexey Lavnikov at 1/25/2006 1:27:11 PM
I'm playing with CodeDOM and CSharpCodeProvider. I've found the following possibilities: CodeDOM -> Assembly C# Source code -> Assembly I miss the C# Source code -> CodeDOM only. Is it there? Or it's hidden under the hood? ...more >>

When the application is started again
Posted by chris.dannemiller NO[at]SPAM gmail.com at 1/25/2006 1:11:09 PM
I am allready preventing a second instance of a application from running using a Mutex. How can I signal the first application telling it that the user wanted to start the application again so I can bring a window to the front for example. ...more >>

Guid.NewGuid() is always returning all zeroes
Posted by cartoper NO[at]SPAM gmail.com at 1/25/2006 12:50:11 PM
I am using VS2004 and .Net 2.0. Every time Guid.NewGuid() is called, the returned guid is all zeroes: {00000000-0000-0000-0000-000000000000} In looking at the MSDN documentation on NewGuid(), it states: "There is a very low probability that the value of the new Guid is all zeroes or equal t...more >>

Nullable Types
Posted by Steven Livingstone at 1/25/2006 12:39:17 PM
I've just blogged some stuff on Nullable types in net 2.0. http://stevenr2.blogspot.com/2006/01/nullable-types-and-null-coalescing.html Question however as to why you can't simply get an implcit conversion from a ..Net value type to to a Sql Server data type rather than having to use null ch...more >>

need help with reading from app config file
Posted by comic_rage NO[at]SPAM yahoo.com at 1/25/2006 12:28:32 PM
Hi, I am trying to read from my application config file and keep getting null. Here is my config file My application is called SampleApp.exe I named the config file: SampleApp.exe.config Inside the config file <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSet...more >>

Detect Office Version
Posted by Kevin at 1/25/2006 12:25:54 PM
Hi! There is a way to detect which office version have a Windows? Thanks ...more >>

Please help with two processing talking to each other!!!
Posted by UJ at 1/25/2006 12:06:44 PM
I'm at my wits end. I have a service that downloads stuff from the web. When it's done it needs to notify a windows app that there's new content for it to display. Everybody seems to say to use remoting but I can't get it to work. I can set up the remote object, I can call the object in the se...more >>

dotlucene question: tighten search results.
Posted by Peter Rilling at 1/25/2006 11:51:48 AM
If anyone has experience with DotLucene, then this question might be right up your alley. I have two lists of music titles. Each from a different source. I am trying to match determine possible matches to associate them. I know that any association on text will not be perfect, but I am i...more >>

PLacing DLL funciton in a class
Posted by Dmension at 1/25/2006 10:54:53 AM
I have a dll that I need to use in an application that I am writing. Can anyone point me in the direction of creating a class in my project that has all the dllimport statements. I have used the dll but all the dll import statements are within the same code.. Sample Code: /// </summary> ...more >>

Normalized datatables, stack arrays, and lots of data
Posted by Scottie_do at 1/25/2006 10:41:07 AM
I have a 20meg in-memory stack-based array and I'd like to normalise in the client's memory... then add foriegn keys, and display results on a datagrid. I discovered that converting the stack to a datatable my memory utilisation increases to 120 megs. (lots of overhead) Couple of questions...more >>

Should this be a warning, at least?
Posted by Rich Sienkiewicz at 1/25/2006 10:40:03 AM
The C# compiler gives warnings about unused variables. I thin it needs a warning about an unassigned reference. For instance, this compiles without any warnings/errors, but of course blows up when run: SqlConnection cnn = null; try { new SqlConnection(myConnectionString); cnn.Open()...more >>

Put int into SqlDbType.Binary typed parameter
Posted by Mihaly at 1/25/2006 9:45:02 AM
I have a parameter typed SqlDbType.Binary and length 30. I can transfer to this parameter an int value. How can I transfer this value? Thanks! Mihaly...more >>

Not able to step into...again?
Posted by Brett Romero at 1/25/2006 9:38:36 AM
My.EXE project does a file reference to a A.DLL. I have the PDB for A.DLL. A.DLL inherits from B.DLL, which I file reference and also have the PDB for. The method I'm referencing in my.EXE is a type of A but derives from B. When the debugger gets to this method and I step into, it skips righ...more >>

How to address each of 12 radio buttons programmatically?
Posted by Jan Smith at 1/25/2006 9:16:30 AM
I have a C# project that has a tab control with four tab pages. On each tab page is a set of three radio buttons (named radioButton1 through radioButton12). I would like to loop through the radio buttons and set their state without having to form the complete name of each one, something lik...more >>

Anonymous Methods
Posted by John Smith at 1/25/2006 9:06:46 AM
I really can not appreciate why Microsoft has introduced Anonymous methods. It promotes quick and dirty style of programming and as I can see it offers no advantages over normal methods. I have spent years reviewing source code and asking people not to write anonymous code (supported by some n...more >>

DB2 Time fields with .Net
Posted by Dale at 1/25/2006 8:46:02 AM
I am trying to store a time in a DB2 time field usinc C# and the IBM managed DB2 data provider. The error I am getting is SQL0181N, "The string representation of a datetime value is out of range." I have tried using the DateTime.TimeOfDay property, the DateTime.TimeOfDay.Ticks property, th...more >>

Exception - Error Code
Posted by Jim Heavey at 1/25/2006 8:44:03 AM
When an exception is generated is there not suppose to be a property which contains the error code? I'm not seeing this property. Does it not show an error code if the exception comes from a COM component? Thanks in advance for your assitance....more >>

Can an XmlDocument file be created from an XSD file?
Posted by Ray Stevens at 1/25/2006 8:14:33 AM
I'm not an expert on XML so have a question I have been unable to find an answer. I have a fairly complex XSD file that was provided to me, for which I used XSD.exe to generate a class. I added both the class and xsd files to a C# VS 2005 project (Not Web Site). I need to create an XmlDocument...more >>

Check for the existance of a specific table in a dataset.
Posted by UJ at 1/25/2006 8:10:50 AM
I'm getting a dataset back from a web service and I want to verify that the table I want exists before trying to access it (which will cause an exception.) Is there an easy way to check for a specific table in my dataset without doing a try/catch or is that the easiest way? TIA - Jeff. ...more >>

Reading Windows Registry
Posted by emferrari NO[at]SPAM gmail.com at 1/25/2006 8:09:34 AM
Hi all I need to make a program that will loop inside the HKEY_CLASSES_ROOT and find the name of the DLL associated with a ClassID. I want to know how can I possible loop inside the classes id ? I tried to look into the documentation of the RegistryKey class but I didn't find something us...more >>

Connection String in .config file - Security Concerns
Posted by WebMatrix at 1/25/2006 8:02:07 AM
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review, one developer suggested that it's a security flaw; therefore connection strings should be kept som...more >>

what is IContainer components for?
Posted by Dave at 1/25/2006 5:37:05 AM
When I create a new form a private member System.ComponentModel.Container components is created, and appears to be passed to the constructors of various things like timers. Can someone explain to me what the purpose of this is. It seems to have something to do with the Dispose method. If I c...more >>

sbyte understanding needed
Posted by garyusenet NO[at]SPAM myway.com at 1/25/2006 4:10:02 AM
Hello i'm just starting out with csharp. and am trying to figure out why an sbyte can take any value from '-128' to 128. i've drawn a BIT box with eight bytes, and I'm assuming the eighth bit is used to SIGN the number, which leaves seven bits. when all 7 bits are on you get : 127 so i w...more >>

Self-restarting application
Posted by GTi at 1/25/2006 4:06:18 AM
Does anyone have any good code for a self restarting application? Sometimes I need to exit my application and start it again, what is the best method of doing this in a windows form application. The reason why I want to this is complicated, so a restart is faster and more easier whey of doing it...more >>

Multicast Question
Posted by Nuno Magalhaes at 1/25/2006 3:23:53 AM
I'm streaming quicktime H264 movies to 224.1.2.3:554. Why, in my MulticastReceiver class of another application, have I have to bind my socket locally on the same remote port (554) in order to receive the multicast packets (with the primitive receive)? Why can't I bind to another port and still ...more >>

Dynamically instantiate class and call function
Posted by Christian Havel at 1/25/2006 2:57:03 AM
Hi, can I create a instance from a class which is another assembly and call a function inside this assembly? I know the assembly name, class name, the function name and its signature. Thanks Christian...more >>

registry changing monitor
Posted by eric at 1/25/2006 2:36:04 AM
Is there any way for .net to get the name of the changing entry of registry in real time? We want to monitor the whole registry and be notified when there was a entry is changed on time. We also want to know the name and path of the changed entry. how can i do this? we appreciate ur hel...more >>

Generic method to return object reference
Posted by acb at 1/25/2006 1:03:39 AM
Hi, I have a list of different objects in a <List> Structure. There is only one category of each kind of object. Current I have the following methods: public static Flag GetFlagObj() { foreach (Thingy s in _Thingies) { if (s is Fl...more >>

Trouble with using User Control in different projects
Posted by crowl NO[at]SPAM gmx.de at 1/25/2006 12:28:07 AM
VS.2003, .NET Framework 1.1, C# My goal: Creating a dll (helper.dll) which contains some UserControls and some other helpful classes in order to use it in other projects. Symtoms: The inital use of the UserControl component works. However, if the Helper Project is recompiled, the UserC...more >>

Accessing Dot Net Windows Application in Network systems
Posted by krishnan at 1/25/2006 12:25:55 AM
Dear All, I am deploying c#.net windows application in client machine. it is working fine. but, When i run the same application from a network path, it is throwing 'security exception'. in dot net framework configuration , what settings i've to chang to work the application fine? Th...more >>

Crystal Report Error
Posted by Steve at 1/25/2006 12:00:00 AM
hey guys, i'm trying to generate a crystal report based on data in an access database, but i keep on getting this error: "Error in FIle c:\......\CrystalReport1.rpt. Buffer too small for string or missing null byte." Any ideas??? cheers Steve ...more >>

file path
Posted by Hrvoje Voda at 1/25/2006 12:00:00 AM
How to check if a file path is correct? Hrcko ...more >>

C# OO concept and SQL Server Table
Posted by Jason Huang at 1/25/2006 12:00:00 AM
Hi, My project is .Net 1.1 C# Windows Form project, and the database server is SQL Server 2000. In one of the database's datatable MyTable, the Primary Key is a Join Key [Name, Number]. Now in my C# Windows form MyForm, it is designed mainly for manipulating the datatable MyTable. I am t...more >>

Transparent Forms that only show a Label's text
Posted by Timothy at 1/25/2006 12:00:00 AM
Hi everyone, I have a question that I hope can be answered. Is there a way to create a borderless form, that has no backcolor (transparent) that has a label (with no backcolor) that is showing? In other words, is there a way to have text on a screen with nothing behind it? Some people ...more >>


DevelopmentNow Blog