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# > may 2007 > threads for tuesday may 8

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

Controlling one instance of the application from another?
Posted by melon at 5/8/2007 10:21:08 PM
Let's say I have a program.exe file. When I run it, one instance of it will be created. If I run it again, then another instance will be created. Question is, is it possible for instance #2 to issue command to instance #1, or vice versa? Thanks ...more >>

using delegate
Posted by ASP.NET explorer at 5/8/2007 9:20:14 PM
The following piece of code (between comment /***************/ line )works fine. You can test is in console/win form/web page. Just print strResult. /**************************************************/ public delegate double DlgFn(double x); public static double f1(double x) { ...more >>

Strange problem with XmlSerializer creating duplicate end tags
Posted by sklett at 5/8/2007 8:32:57 PM
I have several objects that I'm saving to disk via the XmlSerializer. 80% of the time this works fine, but occasionaly it will create a file like this: <?xml version="1.0"?> <SystemOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> ...more >>

How can I create Docs from my source files?
Posted by Kfir Marouani at 5/8/2007 8:10:33 PM
Hi, I'm looking for a way to generate documents from my source files. Like in Javadocs. Anyone? (Thanks in advance) ...more >>

How to create generic class constructor
Posted by Andrus at 5/8/2007 7:01:06 PM
public class BusinessObjectGeneric<EntityType> : BusinessObject where EntityType : BusinessEntity, new() { public BusinessObjectGeneric<EntityType> () { } ..... causes error in constructor declaration: Error 1 Invalid token '(' in class, struct, or interface member decla...more >>

Violation of PRIMARY KEY
Posted by Nime at 5/8/2007 6:09:47 PM
Hi, I want to remove the row then add the fresh new one, so I don't have to decide to update or add. I always add, because I delete any existing row. However I'm stuck with the error below: Violation of PRIMARY KEY constraint 'PK_dtotel'. Cannot insert duplicate key in object 'dtOtel'. ...more >>

C Sharp
Posted by baseballboxgolf NO[at]SPAM mail.com at 5/8/2007 5:26:14 PM
www.BrandonsMansion.com ...more >>

Serializing / Deserializing string array problems
Posted by Ray Mitchell at 5/8/2007 5:18:00 PM
Hi, I know this will sound like a lot of hand waving, and I'll be glad to supply some sample code if necessary, but I thought something obvious might jump out at someone without doing so. Anyway, I have a structure that has several members including an array of strings. I assign the eleme...more >>



reset pc
Posted by Frank at 5/8/2007 4:55:52 PM
Hello all, is there a way to reboot my PC with a c# command? I don't mean 'shutdown -s' or some other command. I mean a hard interrupt (INTxx), like pushing the resetbutton on my PC. Thanks for your help Frank ...more >>

Rolling back file errors
Posted by valentin tihomirov at 5/8/2007 3:59:06 PM
Once file is open, it should be closed: Stream fs = new FileStream(filename, FileMode.Create); try { // write, exceptions may raise here } finally { fs.Close(); } What should one do to remove the file in case of an error? ...more >>

How to use generics?
Posted by Martin at 5/8/2007 3:55:24 PM
Hi all, In the following example, I'd like to replace int by a generic. In order word, I would like to replace int by float, double, byte or something like that. I've tried to find a common interface or something like that, but I didn't find. public static int MaxSum(int[] source) ...more >>

List.Exists Predicate
Posted by John Cantley at 5/8/2007 3:26:54 PM
How do I use this, the example in msdn is basically worthless unless you want to check something against a static string or something. I need to check in my list if there is a duplicate entry, how do I do that? I have a collection of supplier objects. Supplier Name ID Count ...more >>

GridView not displaying data in browser on pressing button Go when bind to DataTable
Posted by weird0 at 5/8/2007 2:58:55 PM
I have created a GridView and dynamically added data to it by creating a DataTable(as advised) and bound it with a reader. Then, assigned the DataSource of GridView to DataTable. But even that aint working as alternatively assigned reader obj. to datasource of GridView. Here is the code f...more >>

TableAdapter generate identity
Posted by Tempera at 5/8/2007 2:41:06 PM
I add new row to DataTable (typed). I called TableAdapter.Upadte method. I noticed that field 'ItemId' (which is specified as Identity in SQL Server) has a value of new added item. This is great! Is this feature documented? Can i use it in production? I also noticed when using Access, Au...more >>

catch all unhandled exeptions does not work for all computers.
Posted by Zytan at 5/8/2007 1:59:03 PM
I am using: Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); But, my function is not run when an exception is thrown on another computer running WinXP SP2, and I have no idea why. Instead, the Windows error report screen appears....more >>

what can cause System.IO.IOException besides for HD errors?
Posted by Zytan at 5/8/2007 1:50:55 PM
I got a System.IO.IOException in my app on another computer, so I couldn't debug it. I don't think it was a HD error. What else could throw this? Could it be from reading a webpage from the internet through a stream? Zytan ...more >>

How Do I Serialze Parent Hosting COLLECTION of Child objects
Posted by DesperateDan at 5/8/2007 1:46:34 PM
I've got a parent object that is a collection and it in turn is hosting 2 child objects. My searlization has worked perfectly to plan in as much that I wanted to dictate the names of the objects and properties via XMLatrributes with a prefix of "THE_.."....except for the name of the child object...more >>

need help using system.Threading...
Posted by Milsnips at 5/8/2007 1:27:16 PM
Hi there, i've created a little test app where i send an email to myself and = select a number from a combobox how many times to send it. My sending function is called void doMailSend() { //send the email here... } and it works fine with threading, however i want to pass an incrementin...more >>

Change colors of ProgressBar control?
Posted by Zytan at 5/8/2007 1:21:16 PM
I am trying to change the colors of the ProgressBar control, using ForeColor and BackColor, but this doesn't do anything. Does anyone know why? I wonder if it has anything to do with Windows insistence on drawing the ProgressBar with the block display, instead of one smooth bar, even if you as...more >>

Slow draw speeds
Posted by Rahvyn at 5/8/2007 12:44:02 PM
Hi all; I have a windows desktop application in which I have set as a background image, a graphic that I whipped up. Its nothing fancey, just some gradient colors, shadows, glow, that sort of stuff. I have tried different formats, jpg, png, gif, bmp, and with every one, when the application...more >>

Deleting all breakpoints?
Posted by Ray Mitchell at 5/8/2007 12:09:02 PM
Hi. I'm using VS2005 Express for C#. How do you clear all breakpoints without having to find them one at a time. In previous versions of the C/C++ IDE I could just use Ctrl+Shift+F9, but that has no effect now in the C# version. Thanks...more >>

Comparing types
Posted by Mike J at 5/8/2007 10:49:30 AM
Hi..need help comparing types example method istypeof(object someobj) { if (someobj=int32) } ya kinda get my idea here.... MJ ...more >>

Open Same Form 2 Different Ways
Posted by BD at 5/8/2007 10:16:16 AM
I am coding with C# in Visual Studio 2005 for a database application residing on remote MS SQL Server 2005. What I want to do is open the same form but from 2 different places and only one instance. I currently have the form where it will open from a double click on datagridview from another f...more >>

Marshal.GetLastWin32Error()
Posted by Larry Smith at 5/8/2007 10:08:18 AM
Hi there, Does anyone know if this (example) is safe: [DllImport("user32.dll", SetLastError = true)] internal static extern int GetWindowRect(IntPtr hWnd, ref RECT rect); int rc = GetWindowRect(hWnd, ref rect); if (rc == 0) { throw n...more >>

Need a quick DDE alternative/solution, Please
Posted by jimcarrey363 NO[at]SPAM gmail.com at 5/8/2007 8:48:20 AM
In a program that I'm converting from VB6 to C# (VS .Net 2003 not 2005) there are a few DDE calls and they obviously don't work anymore in .NET. I'm trying to find an easy way around this because there are only 3 lines of code in the app for DDE. frmDialer.txtDDEPop.LinkMode = NONE fr...more >>

how to create instance by type
Posted by Alex K. at 5/8/2007 8:37:00 AM
Hi all Is there any way to create an instance of a class using its type? I mean something like this: private void util() { object a = null; a = CreateObjectByType(typeof(MyClassA)); } private object CreateObjectByType(Type classType) { ... } Thank you ...more >>

How to unit test a C# library launched from an external program?
Posted by lpcarignan NO[at]SPAM gmail.com at 5/8/2007 5:56:53 AM
Hi all, Right now, I'm debugging a C# library by starting an external application. To do this, I go in the project settings of the C# project, go in the Debug section and check the radio button "Start external program". I then specify the application that will start my library. I was won...more >>

Modifying private variables from outside the containing class?
Posted by lukaslipka NO[at]SPAM gmail.com at 5/8/2007 5:46:19 AM
Hey, Is it possible to set a value for a private variable from outside the class in which it was declared using perhaps reflection? Something like class A { private string s; } class B { private void Foo (string str) { A a = new A (); // Here I need a way to set the val...more >>

Building your own controls
Posted by Jesper, Denmark at 5/8/2007 5:44:09 AM
Hi, I would like to build my own controls from the ground up. Just as if the Combobox didn't excist and I wanted to create this 'new control' with all is glorious functionality. Is there a technology used for this purpose in .net. Regards Jesper....more >>

-=--=
Posted by anil143 NO[at]SPAM gmail.com at 5/8/2007 4:01:58 AM
[lo ...more >>

Printing always the same page on label printer
Posted by Georg Fleischer at 5/8/2007 3:36:06 AM
Hello, I've got a problem which I can not locate. I will try to describe it and would be glad, if someone had an idea how to identify the cause of the problem. Situation: My application prints labels to a label printer (Datamax E-4203) via PrintDocument. The PrintDocument prints a new p...more >>

Run a timer on a different thread
Posted by cashdeskmac at 5/8/2007 1:48:00 AM
Hi, I have an application which does some file manipulation. While the file manipulation takes place, the timer in the statusbar freezes. How can I tell the timer to run on a different thread? Also, my UI freezes if there is a big file to move. I have a label on the form which shows t...more >>

How can I display data using GridView and Reader
Posted by weird0 at 5/8/2007 12:48:48 AM
Below is the code I wrote but it aint working.... : It throws an exception on DataBind() statement that "the source does not support server-side paging". PLz Help. Really stuck. protected void Button1_Click(object sender, EventArgs e) { int AtmtransId=3D-1; if (Sess...more >>

How to convert a byte array to a singe integer
Posted by Star at 5/8/2007 12:09:20 AM
Hi all, Let's suppose we have this: byte[] buffer = new byte[3]; buffer[0] = 0x04; buffer[1] = 0xF1; buffer[2] = 0xB4; int Res; 'Res' needs to be the concatenation of all those bytes. I mean, it should be something like Res = 0x04F1B4 which converted to integer is 324020. ...more >>

Communicating windows service with windows app: remoting?
Posted by Diego F. at 5/8/2007 12:00:00 AM
Hello. I have a windows service running that listens to a port and makes insert queries in a database. I need to make an interface, so my idea is creating a simple windows application that just shows messages from the service. Can I do that with remoting? What are the main steps to do that...more >>

Problem with generic
Posted by Torben Laursen at 5/8/2007 12:00:00 AM
I have a class that is generic and can only be used with numerical types like double or decimals A example code is: class<NumType> { public NumType Test(NumType Val) { NumType d = 0.0; //The problem is this line. This will not compile with the error: Cannot convert type double to NumType...more >>

Selecting and dragging text on a TextBox
Posted by Abubakar at 5/8/2007 12:00:00 AM
Hi, In a normal Windows.Forms.TextBox control, I want to be able to select a text (ie highlight, this is by default possible) and than be able to drag that text through my mouse pointer to another textbox, or any control, than drop it. How do v do this? Regards, ...ab ...more >>

Prevent row high
Posted by PawelR at 5/8/2007 12:00:00 AM
Hi, How do I prevent row high (user can't change row high) in DataGridView? Thx PawelR ...more >>

Change value cell after click on row in DataGridView
Posted by PawelR at 5/8/2007 12:00:00 AM
Hi Group, In my application I have DataTable which is displayed in DataGridView via DataView: DataView myView = new DataView(myTable); myDataGridView.DataSource = myView; One column im myTable is boolean (two state - without null value). How can I change value in this column after click ...more >>

Force update of Databinding
Posted by Johnny Jörgensen at 5/8/2007 12:00:00 AM
I've got a combobox where the SelectedValue property is bound to a class property by a code like this: MyComboBox.DataBindings.Add("SelectedValue", MyClass , "MyID"); My problem is that the MyClass.MyID property gets updated when the focus leaves the combobox - not when you actually select...more >>

associate help file with F1 key
Posted by Doug at 5/8/2007 12:00:00 AM
Hi i have an app that i am writing and i have a help file that is called by the help menu. I would like to associate this help file with the F1 key but when i use the following code, i dont get the help file up. private void F1_keyPress(object sender, EventArgs e) {Help.ShowHelp(this, hel...more >>


DevelopmentNow Blog