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 2007

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

How to drag a picturebox inside a panel control?
Posted by Steven Garrad at 4/30/2007 10:47:40 PM
Hi All, I have a pictureBox control inside of a panel control. The pictureBox is larger than the panel control and I have the panel control set true for AutoScroll so the panel displays scrolling bars. I would like the user to be able to click and drag the image and for it to move around w...more >>

How can I reduce the memory consumption?
Posted by liubin at 4/30/2007 10:30:42 PM
I have created a simple program using C#/.NET. It is very small program without explicit system resources request in the code. However, the memory consumption is even above 17M(shown in Windows Task Manager), much higher than 5M of the same one developed with MFC before. Now I wonder if th...more >>

Cascading Menu for Excel Addin in C#
Posted by shantanu at 4/30/2007 10:11:13 PM
Dear All I have a requirement for creating a sub menu. I have been working on the addin and was able to put the addin in the tools menu of excel. The menu will be something like: 1. Main Item 1.a. Sub item 1 1.a.i sub item 1 1.a.ii sub item 2 1.b. S...more >>

Child form code access to parent code object
Posted by Ray Mitchell at 4/30/2007 8:57:00 PM
Hello, I'm sorry for such a basic question, but here it is: I'm creating a VS2005 C# forms application. In the parent form I have a button that opens a child form. In the code for the parent form I have some public objects and some public methods. How can the child code access those ob...more >>

BinaryFormatter Serialization format? Is it documented?
Posted by googlenewsgroups NO[at]SPAM theisaacfamily.co.uk at 4/30/2007 8:11:28 PM
I have a custom set of objects that is correctly serializing & deserializing the object tree. However in some cases the size of the resultant serialization is larger than I would expect. Is there any documented way to pull apart the stream to determine the sizes of the objects embedded within ...more >>

private static or static private in a field declaration?
Posted by Charlie NO[at]SPAM CBFC at 4/30/2007 8:04:53 PM
Hi: I'm looking at some field declarations. Programmer has it static private int x. Shouldn't it be private static int x? Doesn't the access modifier come before variable modifier? But it compiles. How does this work? Please explain. Thanks, Charlie ...more >>

vista server not accepting connetions
Posted by Bob at 4/30/2007 8:02:41 PM
Hi, I have some code that sets up an asynchronous server. It is working fine on my XP machines but I can't get it to work on Vista. Actually, it "works: in that it runs but when I try to connect via telnet I get nothing. I have tried opening up the port and also turned off the firewall. Neit...more >>

structure of xml classes in C#
Posted by a.kamroot NO[at]SPAM gmail.com at 4/30/2007 7:12:39 PM
Hi I need to exchange XML formated information between two methods in my C# program. I have been trying to play with XMLNode and XMLElement but without much success. I think I want to stop now and understand the xml classes in C# (rather in dot net) before proceeding further. Can any one po...more >>



Interoperatablity in c# and vb. Case Sensitivity issue.
Posted by Sugandh Jain at 4/30/2007 7:01:56 PM
I have a class implented in a c# dll which has two different properties of same name Say "A" and "a". Now, is their any way to use any one or both of these properties of this class in a vb.net project. because it will give the following error Error 2 'A' is ambiguous because multiple kind...more >>

Class file bogging down IDE. Difficult to navigate file...
Posted by Charlie NO[at]SPAM CBFC at 4/30/2007 6:58:13 PM
Hi: I just took over support for a WinForms application. While trying to navigate a class file, IDE stalls making it very difficult to navigate file without bogging down. Feels like something is overloading IDE. File is 98KB (about 2000 lines of code) which shouldn't be too big. Any one...more >>

Function for Factorial.
Posted by Sugandh Jain at 4/30/2007 5:41:57 PM
Hi. How to write a function that will return me the factorial (say in a string) for the any positive integer it takes? When we find a factorial of even say 2000 or a higher number, it will be very big to be accomodated in int or long datatype. Regards, Sugandh ...more >>

Animated GIF
Posted by piter at 4/30/2007 5:18:17 PM
Hi. I have a button with an image which is animated gif. I need this animation to be played only when button_Click event occur. How to force form not to play animation until button is pressed? PK ...more >>

Confused about proc vs. dynamic SQL vs LINQ
Posted by Ronald S. Cook at 4/30/2007 2:39:35 PM
I've always been taught that stored procedures are better than writing SQL in client code for a number of reasons: - runs faster as is compiled and lives on the database server - is the more proper tier to put it since is a data function But then I've heard that writing SQL in my client .NE...more >>

Passing data between two open Forms (neither is MDI)
Posted by VMI at 4/30/2007 1:55:32 PM
I have a Windows Form Form1 (not MDI) and when I double-click on the Form, another Form2 will "pop up". How can I pass the text that I typed in Form2 to a textbox in Form1? I was thinking if it was possible that from Form2 I can call a public method in Form1 that updates the Textbox. I wanted ...more >>

How do you emulate a "print-screen"?
Posted by fischermx NO[at]SPAM gmail.com at 4/30/2007 1:43:04 PM
My software should take snapshots from the current screen from an icon in the try area. I need to programmatically emulate what the "print-screen" keyword does. How do I do that ? Thanks in advance, ...more >>

Executing COM+ class
Posted by Slavan at 4/30/2007 12:39:55 PM
I am trying to execute following code: Type type = Type.GetTypeFromProgID("SomeType.SomeClass", true); object helper = Activator.CreateInstance(type); and get following RemotingException (in 2-nd line): Cannot load type SomeType.SomeClass, SomeType.SomeClass, Version=1.0.2658.25296, Cultu...more >>

Is there a debug.print in CSharp?
Posted by Dom at 4/30/2007 11:59:04 AM
VB had a neat object called "Debug". You could use "Debug.Print()" in your code, and you could get useful debugging information in the immediate window. Is there something like this in CSharp? Dom ...more >>

How to eliminate delay making first call to a webservice?
Posted by DaveOnSEN at 4/30/2007 11:57:29 AM
Every time I make any .NET framework based webservice consumer I have the same problem: The first call my application makes to consume a webservice takes about 15 seconds. Subsequent calls are very fast. What is happening during this initial delay, and is there anything I can do to fix this so ...more >>

"Use of unassigned local variable" error
Posted by Dom at 4/30/2007 11:48:10 AM
This is a little tricky, but I think the error I'm getting isn't valid. The compiler just doesn't know my logic. MyObject o; switch (IntVariable) { case 1: o = new MyObject() break; case 2: o.MySetting = "Test Setting" break; } The com...more >>

Multiple lines in ListView column header titles?
Posted by Ray Mitchell at 4/30/2007 11:02:06 AM
Short of writing a custom version of the ListView control, is there a way to force the column headers to contain multiple lines. The problem is that the actual values of the items in each column only need 2 or 3 characters while the description of them in the column title takes many. Thus, m...more >>

run .net application from remote machine
Posted by DarthSidious at 4/30/2007 11:02:01 AM
hello, i need to run an application from a remote machine in the same intranet. But everytime i do something like "\\server\app\aplication.exe" i get a clr error. How can i do this? i can't install the application on every machine... this was not a problem with vb6. thanks!!! ...more >>

Determining if two paths are the same
Posted by Mark Chambers at 4/30/2007 10:27:40 AM
Hi there, Given two file names in relative or absolute format, I need to determine if they point to the same file. While I can simply pass each to "Path.GetFullPath()" and compare the results, what is the rule regarding case. That is, how do you determine whether the local file system is ...more >>

C# Profiler
Posted by Vai2000 at 4/30/2007 10:07:39 AM
Hi All, Does anyone know of a tool which can profile my assembly, so that I get a stats on all the methods called and how much time each took? TIA ...more >>

syntax issue?
Posted by GotDotNet? at 4/30/2007 8:58:30 AM
I'm trying to insert data from one table to another on sql server via C#. here is my syntax: insert into tableA (CustOrderNumber, custName, custState, CustCity) SELECT ('" + System.GUID.NewGUID() + '", Name, State, City) from custSales I'm getting this error message: There was an error p...more >>

Strange container behaviour?
Posted by Juergen D. at 4/30/2007 8:40:02 AM
When I try to run this following small code sample: using System; using System.Collections.Generic; class Program { static void Main(string[] args) { Dictionary<string, int> MyDict = new Dictionary<string, int>(); MyDict["aaa"] = 0; MyDict["aba"] = 1; ...more >>

Specify a framework version for devenv.exe
Posted by cashdeskmac at 4/30/2007 8:30:01 AM
Hi, at the moment I have a batch file which builds a lot of projects. A typical line in the batch file would be: CALL "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe" Report.Change.sln /rebuild Debug /out Report.Change.plg Now that I have installed VS 2005 ...more >>

Window Service and Threads
Posted by JJ at 4/30/2007 8:00:51 AM
I have a window service that spawned a separate thread. Now I would make sure to process some work and then close the thread. After I closed this thread I wanted to shut down the service but would never be able to stop service even though I would call OnStop() on the service. Now I went another ...more >>

Progress bar not updating while form loses focus
Posted by Manikandan at 4/30/2007 7:58:20 AM
Hi, I have a form with progress bar. I'm querying sql server with large number of records(around 1 lakh) for export The records are written to a text file I'm showing the process running by updating the progress bar If the form loses focus(i.e selecting any other application) means progress b...more >>

Casting as an enum type
Posted by NullQwerty at 4/30/2007 7:25:38 AM
Hey folks, So, I've got three enum types: enum enum1 enum enum2 enum enum3 And then I've got a function overloaded three times to accept each enum type: private void func(enum1 myenum){} private void func(enum2 myenum){} private void func(enum3 myenum){} And then I've got a wrapper f...more >>

Missing Reference
Posted by jez123456 at 4/30/2007 6:36:03 AM
Hi experts. I have a c# widows program that uses 3rd party dlls. All works correctly on my PC but when I try to run the exe on another PC, I get an error indicating a missing reference. I checked the other PC and all the 3rd party the dlls are present and registered. Is there anything I ...more >>

step through a struct using foreach
Posted by titan nyquist at 4/30/2007 6:20:01 AM
Can I step through a struct using foreach? I want a method that steps through a struct, and prints out the name/value of each member. Can it be done? The error I get when trying this is: "foreach statement cannot operate on variables of type '...' because '...' does not contain a public de...more >>

K-mean clustering algorithm!
Posted by Shum at 4/30/2007 4:38:48 AM
Hi! I need help ragarding the k-mean clustering algo. Any one have a source code in c#.. or a dll file that could be used in the project.... I cannot seem to identify the objects that could be used in the algo.. I have to group the diseases according to provinces, and plot them in graph, this ...more >>

how can i assign an alt text in c#
Posted by Dr. Sevencan at 4/30/2007 4:30:03 AM
how can i assign an alternate text to a button like we do to html pictures with ALT? i am working under c# environment. thanx in advance -Dr. S. ...more >>

Automation urgent pls
Posted by Badis at 4/30/2007 4:16:02 AM
I'm doing a server side automation(I know it's bad but..) and its working fine locally and when accessing it from a remote machine using web browser is was giving me this error"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the ...more >>

Multiple Clicks
Posted by sushma at 4/30/2007 2:58:27 AM
Hi all. I have a web browser which has a button on it. That button click events starts a new independent process and that process uses a file thats needs to be read during its load function. my problem is when the user continuously clicks the webbrowser button i get an exception as the file is...more >>

Remove rows from CSV files
Posted by kr_amitso NO[at]SPAM indiatimes.com at 4/30/2007 2:52:19 AM
I need to remove top 3 files from csv files before reading csv file. please give me link or peace of code for removing the rows from csv file. Thanks, Amit ...more >>

Windows Services and UI
Posted by Diogo Alves - Software Developer at 4/30/2007 2:36:02 AM
Greetings, I would like to create a windows service that would expect an event from my software to import data from a device and/or to import data in scheduled times My questions are: - How can I tell the windows service to import data from another application? - Is it possible to have a U...more >>

A Question of Style: Accessor Methods
Posted by bg_ie NO[at]SPAM yahoo.com at 4/30/2007 1:46:35 AM
Hi, I'm not happy with the way in which I use accessors and was wondering if there is a better way of defining them. Take the following example - class MyClass { // prepended to version names appearing in version combo box private static string versionPrefix; // the current...more >>

Handling Cancel on Form Close
Posted by bg_ie NO[at]SPAM yahoo.com at 4/30/2007 12:58:09 AM
Hi, I have an event handler to handle the closing of a form. In this handler (Form1_FormClosing), I ask the user if they wish to save updates made to a file. I wish to add the option to the message box to allow the user to cancel so that the form doesn't actually close. This is the behaviour ...more >>

Inheritance Problem
Posted by Gaz at 4/30/2007 12:00:00 AM
This is as barebones as I can get it in order to explain my problem. **************************************************************************** using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static voi...more >>

Use reflection to copy a class
Posted by Torben Laursen at 4/30/2007 12:00:00 AM
I have a complicated class that I use to store a lot of values Now I need a copy of that class and I have been trying to find a way to do this automatic so I don't have to assign all properties and classes by hand (about 200 properties). I found this post on google: http://www.thescripts.com...more >>

How to remove comments from SQL string
Posted by Andrus at 4/29/2007 11:24:11 PM
I have SQL strings which contain comments starting with -- and continuing to end of line like string mystring=@"SELECT data, -- ending comment -- line comment FROM mytable "; How to remove comment from those strings ? I need to delete charactes starting from -- and end...more >>

how to use ado.net to manage a dynamic database?
Posted by gobis at 4/29/2007 10:52:21 PM
Hello all, I am working on a csharp database application that should give its end users the ability to create new tables related to existing ones or even create the database structure completely on their own. I know how to do that by creating a DataSet object and adding tables and relations...more >>

Newbie needs help with ThreadPool
Posted by Raymond Du at 4/29/2007 9:01:32 PM
Hi, This is my first mutiple threading progam, I have an AST.Net page zThreadPool.aspx which has one button: button1 and one Label: label1. The following code snippet does not work at all: public partial class zThreadPool : System.Web.UI.Page { void CallbackProc(object obj1) { ...more >>

[OT] - Svn Multiple Repositories on Windows
Posted by Diego Jancic at 4/29/2007 7:48:34 PM
Hello everyone!, I installed SVN Server on Windows a few weeks ago using SVN-1- ClickSetup, and I realized that all the files in all the projects have the same version. My dir structure is something like this: - svn://server/ - Project_1 - trunk - (some files)...more >>

Drawing system architecture
Posted by Bllich at 4/29/2007 3:30:56 PM
Hi, what program should I use to draw these kind of graphics easy? http://tinyurl.com/2vy4oe -- If a "7–11" is open 24 hours a day, 365 days a year, why are there locks on the door? —Nick Featherman...more >>

Orcas beta issues
Posted by DeveloperX at 4/29/2007 3:07:00 PM
Hi, I've just downloaded the Orcas Express beta and it bombs on the first step (installing the 3.5 framework). It doesn't give me a specific error, it just calls home, tail between its legs :( I've tried the following: reburnt the image. disabled AV. Haven't got as far as "Profit"... An...more >>

Identify Underlying OS Platform?
Posted by Mahmoud Al-Qudsi at 4/29/2007 1:40:07 PM
Hello, I'm trying to identify whether my C# .NET 2.0 application is running on a Windows x64 or x86 version. I'm trying to avoid checking the version numbers because this will have to work on Vista too, which shares identical build numbers for x64 and x86. I'm currently using this: if...more >>

Interface & Event
Posted by hufaunder NO[at]SPAM yahoo.com at 4/29/2007 1:25:23 PM
I have an interface ITest that includes an event TestStatusChange. There is also a class Test that implements ITest. In one of the functions of Test I want to call the event (see code at the end) but get the following error: "The event 'eventTest.Test.TestStatusChanged' can only appear on the ...more >>

Adding two doubles gives incorrect result?
Posted by Fabio at 4/29/2007 1:30:00 AM
Hi Looking at the following code ... double a = 100.1; double b = 0.1; double c = a + b; I would like to know why the value of c is 100.19999999999999 and not 100.2? What should I do to correct this. Thanks. ...more >>


DevelopmentNow Blog