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 2006 > threads for tuesday april 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

.exe path for non-GUI application
Posted by Joachim at 4/25/2006 10:40:02 PM
Application.ExecutablePath gets the .exe path when doing Windows programs. If you don't have access to Application - how can you find the .exe path?...more >>

How to access main form functions from child forms
Posted by eric_berlin NO[at]SPAM msn.com at 4/25/2006 10:14:07 PM
I imagine that this question has been posted before, but I couldn't find it. I have an app with several custom dialogs (windows forms) and I need to access methods that are on the main form. The only way I have found this to be possible is to make the main form functions static, but that is too ...more >>

Updating datatable using datatable.rows.find()
Posted by Lars E at 4/25/2006 10:03:58 PM
Hi all I have a small problem. I have a datatable with 8 columns. But it is only data in 5 of the columns. Data for the remaing 3 columns is in another dataset. I Want to run trough the datatable and fill out the remaining data. My code so far: if (this.fetch("custinfo", "fetchCustInfo"...more >>

Executing code on parent thread
Posted by sklett at 4/25/2006 8:06:43 PM
I'm fairly new to Threading and things have been going pretty smooth so far. I did some performance testing on my new app and realized it's lagging a bit on raising events. It's a realtime app and I need to really make sure that I'm not falling behind (hence the multi threads) so I determined...more >>

Changing ContextMenu
Posted by Libby Sharf at 4/25/2006 6:00:10 PM
Hello, I have several ContextMenus and I want to connect them to the GridControl's ContextMenu property depending on the row that was right clicked. Is there an event that is raised just before the ContextMenu is displayed? (In Delphi we used to have the ContextPopup event and we could change th...more >>

radio button in datalist
Posted by Vikas Kumar at 4/25/2006 5:39:53 PM
i am selectin some data from database and through reader showing it in datalist as above now for radio buttons i have single column which returns 1,2,3 and according to that i want one of above radio button to be preselected in this datalist how can i do that doing something like this but th...more >>

Starting on C#...
Posted by Volker Hetzer at 4/25/2006 5:25:01 PM
Hi! We are thinking of doing some performance intensive parts of our application in C#. However, I'm a bit concerned about this GC stuff. From my time as C++ programmer it was pretty easy to use heavy objects that for instance contain a database conenction and I could be sure that when the fu...more >>

Outlook COM object in C#
Posted by Bruno Windels at 4/25/2006 5:04:30 PM
Hi, I am developping an application in C# that creates outlook contacts from a database. For the outlook part of the application, I use the outlook COM object (Version 11 from Office 2003). If a contact is already present in the outlook contact database, it should be updated. Therefore I stor...more >>



Is there a good Text/Word control?
Posted by Mateusz Rajca at 4/25/2006 4:43:01 PM
Hello, I am writing a text editor in C#. Is there any good and free text control similar to Word? Matt...more >>

Gridview returns old value of gridview.rows.count!
Posted by MC at 4/25/2006 4:38:44 PM
I have a label that shows the number of records returned by my gridview. So after gridview ondatabound event I check to see if the gridview.rows.count > 0, and if true then show row count in label but empty gridviews my label shows an old row count of the previous gridview. What can I do to ge...more >>

C# 2005 Samples?
Posted by utpal at 4/25/2006 4:09:01 PM
It seems MSDN for Visual Studio 2005 is giving just the VC++ samples. Are there a place for Microsoft provided VC# samples? ...more >>

Enumerate projects in a solution
Posted by Pete Kane at 4/25/2006 4:03:10 PM
Anyone know how to enumerate all projects contained in a solution, basically I want to loop through my solution(s) projects and add some header info to all my "compileable" source files, I know how to retrieve project items but need some help with the solution part many thanks...more >>

HHow to write an xml parser based on an xsd?
Posted by jens Jensen at 4/25/2006 3:30:55 PM
I'm given an xml schema an i need to parse xml based data receive via http post and produce response . How can i parse the xml based on the .xsd file. many thanks JJ ...more >>

How do I populate a DataSet from a SQL Server 2005 xml datatype
Posted by Thirsty Traveler at 4/25/2006 2:57:59 PM
I have an xml column in a SQL Server 2005 table that was populated with a DataSet. I would like to read that column back into a DataSet object but am not quire sure how. Any ideas? ...more >>

changing font styles
Posted by Lee at 4/25/2006 2:36:59 PM
Hi, How do I change the font styles in a rich text control (i.e. to bold, underline ect) programmatically? thanks ...more >>

Excel Automation
Posted by OutdoorGuy at 4/25/2006 2:17:38 PM
Greetings, I am attempting to use Excel automation to open a workbook, manipulate some cells and then save the workbook. All is working well with the exception of the "SaveAs" command. I am receiving several compile-time errors using this code and can't figure out what is wrong. To verify ...more >>

ThreadAbortException as soon as breakpoint reached in thread
Posted by Joachim at 4/25/2006 1:55:02 PM
When setting a breakpoint in a thread that I have created and the debugger reaches that point, Visual Studio just hangs for about 10 seconds and then, when I try F10 the thread ends and the debug output shows a ThreadAbortException. I'm not doing any other operation than .Start() on the thre...more >>

Try/Catch Array Scope Problem
Posted by Matt Harvey at 4/25/2006 1:50:18 PM
The solution to this is most undoubtedly obvious, but I can't seem to figure it out...your help is appreciated. Let's say I have a block of code that looks like this: string[] array1; int i =0; try { array1= new string[10]; while (i <10) { array1[i] = i; i++; } } catch ...more >>

What does this mean [DefaultValue(false)]
Posted by tony at 4/25/2006 1:31:32 PM
Hello!! I have some demo programs written in C# and they have this construction "[DefaultValue(false)]" see below. I haven't seen this before so what does it mean ? [DefaultValue(false)] public bool ShowDropDownButtons { get { return showDropDownButtons; } set { ...more >>

Multithreaded multicasting and multihandling
Posted by Dave Booker at 4/25/2006 1:29:02 PM
If I subscribe multiple event handlers to an event, then they are called sequentially, right? Is there a native way to have them invoked simultaneously in separate threads, or would I have to build that functionality myself? (I don't want to reinvent the wheel here.) MORE IMPORTANTLY: Is ...more >>

Integrate TV into Windows app?
Posted by Ronald S. Cook at 4/25/2006 12:48:40 PM
I have a Windows app in which I wish to integrate TV (via a TV tuner card). Hauppauge claims to have ActiveX/OCX capabilitues but they are years old, no longer supported, and don't work with .NET. AVI seems to be a big maker of such cards, but I can't find out if they have an ActiveX or ot...more >>

split method
Posted by Alberto at 4/25/2006 12:48:36 PM
I have to store in a string array all the words of a text file. Actually I'm doing this: string [] v = text.Split(new char[] { ' ', '\n', '\t', '\r'}) but it doesn't work fine. When a new line is found the split method returns two spaces. How can I do fix it? Thank you ...more >>

SerialPort Problem. Help!
Posted by Eric at 4/25/2006 12:29:01 PM
I'm trying to send a text message via my cell phone using the .net 2.0 SerialPort object. The command to send a text message requires a newline "\n" and a ctrl-z command to be entered. I've tried entering the control-z character "(char)0x1A" but that doesn't seem to work. I also set the e...more >>

DataTable reference
Posted by Marty at 4/25/2006 12:01:02 PM
I have created a DataSet (dsCurrent) and to it I have added 3 DataTables. Using the same DataTable variable (dtCurrent). I am trying to get a reference to it by doing something like. DataTable dt = dsCurrent.Tables("Table1"); but that obviously doesn't work. How can I do this? Thanks, ...more >>

Table Adapter with null on numerical data
Posted by Michel Walsh at 4/25/2006 11:48:16 AM
Hi, Just get my hand on "Data Binding Windows Forms 2.0 Programming Smart Client Data Applications with .Net", by Brian Noyes (Addison Wesley), with a nice illustration on using generated code with strongly type dataset, in the chapter 2. BUT, I have a problem with Null, when on a n...more >>

how we best parse incoming email messages?
Posted by Li-fan Chen at 4/25/2006 11:40:32 AM
Hi, We find ourselves in the unenviable position of creating an email reader, may I ask how we best parse incoming messages? Ideally we would point the parser at a email stored in a POP3--grab the email body's bytestreams, and get back an array of AttachmentFile collections (filename, siz...more >>

Generate value for base() constructor
Posted by russ.haley NO[at]SPAM gmail.com at 4/25/2006 11:09:55 AM
My question is mostly syntactical but I can't seem to find an answer for it: I would like to create a constructor on a derived class that creates one of the parameters for the base class and then passes it to the base class constructor as follows: public abstract class BaseClass { pri...more >>

Opening a File using "File.Open"
Posted by OutdoorGuy at 4/25/2006 11:03:16 AM
Greetings, I have a "newbie" question in relation to opening files from C#. I have a Windows form where I allow the user to type in a file extension in a text box (e.g., "xls"). I then take that extension and use that as my filter criteria for the File Open dialog. Once the user selects...more >>

3-tier layers
Posted by Dan Aldean at 4/25/2006 10:48:50 AM
Hello, I try to understand how the business and presentation layers would practically translate into programming reality. I read lots of articles about 3-tier, but none of them gave a practical example and I managed to understand the data layer only. Is for example web services and their ...more >>

Checking DEBUG constant from different assembly?
Posted by Brett Romero at 4/25/2006 10:10:48 AM
Say I have this setup: [A.DLL] public static void SomeMethod() { #if DEBUG .... #endif } [B.EXE] A.Class1.SomeMethod(); In A.DLL's project property build tab, DEBUG constant is turned off while it is one for B.EXE. This isn't transient however. The code doesn't execut...more >>

Debug Question
Posted by Tom at 4/25/2006 9:59:01 AM
While in debug mode in my C# app, I wanted to check a value so I set a break statement and in the immediate window I entered: ? parentnav and hit the Enter key. Since this is an object I got the first 99 lines or so followed by this: <More... (The first 100 of 134 items were displayed.) >...more >>

call a specific element of DataSet
Posted by Francoise at 4/25/2006 8:55:02 AM
Hi It is possible to call a specific element of a DataSet? I couldn't figure out it yet. I tried to use the following code but obviously it doesnt work. Hope you can help me! foreach(DataTable myTable in myDataSet.Tables) { foreach(DataRow myRow in myTable.Rows) { _oper = myTabl...more >>

Event does not appear in Properties window?
Posted by David Veeneman at 4/25/2006 8:22:06 AM
I have declared an event that uses generic event args and a generic event handler: // Delegate public delegate void ItemChangingEventHandler<T>(object sender, ItemChangingEventArgs<T> e); // Event public event ItemChangingEventHandler<DateTime?> ValueChanging; The evnt and delegate wo...more >>

multi control naming convention
Posted by Sturdy at 4/25/2006 8:01:02 AM
Hi, I'm new to C# and .NET. I'm a first time user of Visual C# 2005 Express and have a very basic question. I've looked at several links and lots of docs but can't find any tips on naming multiple controls used for the same purpose on different Forms. Specifically, I have several identical...more >>

TreeView with associated form for each node
Posted by ShadowFil at 4/25/2006 7:31:03 AM
Hello, In a MDI application, I want a child form which contains a treeview with a associated form for each node. If I create a child form, I only can put controls. So I can puta Treeview control and a user control which represents the form for one node. So I have the same count of user c...more >>

selects in a mdb file
Posted by gfexrd NO[at]SPAM yahoo.com at 4/25/2006 7:28:36 AM
Hi, I need to know how to retrieve many records from an access datafile, one by one. Let me explain you. I have an array with 2 column by 1000 rows, in one column I have part code, the other is for the cost that I have to search in a Access file. I have to make one Select command with XXX ...more >>

System.InvalidCastException: Specified cast is not valid.
Posted by chrisshearier NO[at]SPAM yahoo.com at 4/25/2006 7:00:33 AM
The below statement is causing System.InvalidCastException: Specified cast is not valid. Can anyone see what is going wrong with this and help me out. string statement = Convert.ToString("Select ConfNum from Call" + " where AcctNo = '" + r["AcctNo"] + "'" + " AND BegDate = '" + DateOfCall ...more >>

GridView RowCommand event
Posted by Mike P at 4/25/2006 6:50:42 AM
I have a ButtonField in my GridView with a CommandName, and I have a method which I am using to capture each click of the button : protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "OpportunityDetails") { ... } } My...more >>

HtmlElement.OuterHtml.Replace() fails with COM exception
Posted by cweeks at 4/25/2006 6:39:31 AM
Dev env: VS 2005 C# Express, .Net Framework 2.0 I am trying to programmatically select an item in a listbox on a web page. The first thing I do is go through and de-select any selected items. The OuterHtml field of a selected element in the listbox looks something like this: <OPTION value...more >>

Enable/Disable Hardware Device (Device Manager) programatically
Posted by RootSpy2006 at 4/25/2006 5:33:02 AM
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: ----------------------------- 1.> Open Device Manager(The keyboard device will have an exclamation and will read:"Could not st...more >>

Value types in a hashtable
Posted by Udi at 4/25/2006 4:32:33 AM
Hi, I need to store an int in a hashtable and still be able to work on it outside the hash. I mean I'd like to store in the hash the int's pointer and not the int itself to overcome the boxing procedure. Can it be done? Do you have other ideas? Thanks. ...more >>

Who owns C#?
Posted by Sathyaish at 4/25/2006 3:47:10 AM
Who owns the language C#? I'm not talking about the compiler, but about the language? Who owns it - Microsoft or the ECMA? I see there are two specifications to each version: 1. One that comes out from Microsoft; and 2. Another that is a follow up from ECMA TC39 (ECMA-334) that is revised aft...more >>

Combine data from 2 tables in datagridview
Posted by Lars E. at 4/25/2006 3:45:11 AM
Hi all. I am trying to combine data from 2 tables in one datagridview. I have tables: "Customer" and "CustomerContact". I want to display Customer information (displaying all fields in customer and some fields from customercontact) in a datagridview. I am not using sql so innerjoin is not p...more >>

FREE C# ebook
Posted by Trax at 4/25/2006 2:13:01 AM
One good FREE C# ebook: http://csharpbooks.infowebpages.info/ have someone more good C# links here? ...more >>

Islamic Calendar
Posted by SYED HANIF at 4/25/2006 1:53:38 AM
Hi Any body aware of Islamic Calendar and how to use it in dot net application i want to use Islamic Calendar in asp.net 1.1 how to get this functionality of islamic calendar control in web form kindly i need help pls let me know about this problem kinds regards SH SYED HAN...more >>

Pre-processor directives
Posted by Sathyaish at 4/25/2006 1:35:32 AM
Can we have a pre-processor directive such as #define LEN 132 in C# v1.1? If so, are there any restrictions as to the scope of such a declaration? ...more >>

Parsing Problem.....
Posted by Wallace at 4/25/2006 12:30:53 AM
Hai all, In VC++, CString str = " 4 76 1"; int nNo = atoi(str.Mid(0,8)); it returns nNo = 4 as output.... it returns the first integer occurence and neglects the remaining character.... Similarly, In C#.NET I do the same as following.... string str = " ...more >>

Need to write an HTTP server , can i use a webservice with "NOSOAP"?
Posted by jens Jensen at 4/25/2006 12:00:00 AM
Hello, I got this "breath taking" task to write a an http server to which "xml data" will be posted to and will answer with xml data. The logic behind the xml processing is not a matter here. My question is : Can i configure a webservice for HHTP POST ? The remote peer just performs an h...more >>

leaks in GC?
Posted by Michael Sander at 4/25/2006 12:00:00 AM
Hi, I'm pretty sure I must do something terrible wrong, but it surely does look like some sort of leak in the GC. (.NET 1.1) What I did: created a form, dropped a ContextMenu on it, connected it to the form. Then I added an emtpy MenuItem to the Menu. No events for the MenuItem, nothing el...more >>

MSBuild: publish w/o build
Posted by Marc Gravell at 4/25/2006 12:00:00 AM
I have a C# project that uses a node-licensed 3rd-party control; I also wish to deploy this using a signed ClickOnce manifest. The 3rd-party license exists on my development box; the code-signing certificate exists on the build server. I don't really want to consume a license just for the ...more >>

How to reading a file when the file is already opened for write
Posted by chinthamani at 4/25/2006 12:00:00 AM
Hai I want to open a file and read when the same file is already opened for writing. I need to do the reading process simultaniously when the file is being writen. Regards. S.Vinodh Noel Software Engineer (Bells Softech Limited) Bangalore. ...more >>

About form load
Posted by tony at 4/25/2006 12:00:00 AM
Hello! I have a demo program that have this event handler Form1_Load below. I just wonder is it any difference if the call to this Form1_Load is removed and the call to InitGrid() is done in the constructor instead. So what is the point having this method Form1_Load if the same can be done i...more >>

XML Serializer
Posted by beachboy at 4/25/2006 12:00:00 AM
Hello all, I want to generate xml with serialization. I write a class for 2nd level Element <SchoolInfo>, but how to handle the <Staffs> Element and create repeated <Student> Element and own attributes. format as below: <School> <SchoolInfo> <Name> <Address> ...more >>


DevelopmentNow Blog