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# > october 2006 > threads for wednesday october 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 31

Convert latin to a-z
Posted by Benny at 10/4/2006 10:44:48 PM
Is there a way in dotnet to do the following convert? =C4 =3D> A =E4 =3D> a =E9 =3D> e ...more >>

FileVersionInfo.GetVersionInfo for outlook add in
Posted by semedao at 10/4/2006 10:33:56 PM
Hi , I am looking for the simple way to get the FileVersionInfo.GetVersionInfo for outlook add in - for the host com also I want to know how to get it in: Console application and in Service application in Windows forms I have the Application.ExecutablePath , but I don't find the sa...more >>

Installing a Windows Service programmatically
Posted by sunil at 10/4/2006 10:06:51 PM
Hi all, I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based on the code sample, it provides the feature to install service under LocalSystem account. What I need is t...more >>

How to iterate over and Enum?
Posted by garth NO[at]SPAM silverminute.com at 10/4/2006 9:38:35 PM
Hi, Is it possible to iterate over and enumerated type in C#? If so please can you paste a simple exampel up that covers the whole process. Thanks ...more >>

How do I refresh a ComboBox who has ArrayList as Datasource?
Posted by MrNobody at 10/4/2006 7:52:02 PM
I have a ComboBox on my form, and I set it's DataSource to an ArrayList of custom objects. Everything loads fine, all the entries I initially loaded into the ArrayList appear in my ComboBox. However, while my program is running and I add a new object to that ArrayList - this ComboBox is not...more >>

Convert VB.NEt to C# problem
Posted by Mike Howard at 10/4/2006 7:10:30 PM
I'm trying to convert the following (simplified) VB.Net code to C#, that makes use of some externally developed COM code written in VB6. VB.Net Code Sub Main() Dim oAPP As Object Dim oApp2 As APP2.Class Dim user As String Dim pass As String D...more >>

Using GetType() inside a generic?
Posted by Ympostor at 10/4/2006 6:11:37 PM
Can't I do some syntactic sugar like this?: MyClass MyObject = new MyClass(); MyStaticClass.MyMethod<MyObject.GetType()>(); Thanks in advance. -- ...more >>

Calculating Bytes/KB/MB/Gb...
Posted by PiotrKolodziej at 10/4/2006 5:52:03 PM
Hi I have long variable containing number of stored bytes. I want to display Bytes , KB, MB, GB depending of the size of this variable as a string. Does framework provide any class for such a fast calculation or i have to divide by 1024, check if result is zero, if not divide again and so on....more >>



Indenting XML output?
Posted by David Veeneman at 10/4/2006 5:46:56 PM
I'm having a problem getting XML output properly formatted. specifically, line breaks and indentation are missing, even though I'm using an XmlTextWriter with Formatting = Formatting.Indented. Here is the code that's generating the problem: static void Main(string[] args) { // Create...more >>

Memory used by a specific process
Posted by Avi at 10/4/2006 5:14:51 PM
Hi all, In my program I need to know the memory used by certain applications. I was able to get the free available memory on the machine, but not the memory that is used by a specific application. Is there a way of doing it? Thanks, Avi ...more >>

form designer
Posted by Arkadiusz Smolak at 10/4/2006 5:12:38 PM
Hi, I need a help. I have form inherited from other form. The base form implementation is placed in other assembly. I try to open my inherited form in designer but visual studio throws an exception. My question is: "how can I debug visual studio form designer?" As I remember in Visual 6.0 i...more >>

custom operator++ yields InvalidProgramException
Posted by Dennis Zickefoose at 10/4/2006 5:01:02 PM
The following code yields error CS0131: "The left-hand side of an assignment must be a variable, property or indexer": (new int())++; However, when using a class with a custom operator++, an InvalidProgramException is thrown. I assume this is a compiler bug of some sort, and that error CS...more >>

Eventhandlers, C#, VS2005
Posted by Gina_Marano at 10/4/2006 4:30:41 PM
help, help, help. The microsoft documentation is getting me in a tizzy. What is the difference between the following: timer1.Tick += new System.EventHandler(timer1_Tick); & timer1.Tick += this.timer1_Tick; They both compile and look like they work the same. ~Gina~ ...more >>

WinInet C# - InternetSetOption
Posted by Mateusz Rajca at 10/4/2006 4:23:01 PM
Hi! How can I code the Work Offline function using Wininet and InternetSetOption. I found some stuff in VB and Delphi but not in C# :-( ~Matt...more >>

> works but = doesn't
Posted by Laurel at 10/4/2006 3:05:32 PM
If I use the following clause in my code I get two errors on this line. if (dsFacultyBio.Tables[strTable].Rows.Count = 0) The errors are C:\DEV QX C#\6.4.1\QX.Data\QXFaculty.cs(318): Cannot implicitly convert type 'int' to 'bool' and C:\DEV QX C#\6.4.1\QX.Data\QXFaculty.cs(318): Prope...more >>

Timer Array in c#, VS2005
Posted by Gina_Marano at 10/4/2006 2:28:57 PM
I have created an array of timers (1-n). At first I just created windows form timers but I read that system timers are better for background work. The timers will just be monitoring different directories and updating a database. No interaction with the GUI. Problem is that the system timers do...more >>

Why instantiate a class, all of whose methods, properties, and events are static?
Posted by sherifffruitfly at 10/4/2006 2:13:53 PM
Hi, I'm learning the .net Bloomberg api, and it's main class has all of its stuff static. The help then goes on to say that the class is implemented as a singleton. It's cool I guess to make sure not more than one instance can be made, but with everything in the class static, I don't actually...more >>

How To Make Text Transparent [Win C#]
Posted by MikeY at 10/4/2006 2:10:32 PM
Can anyhow direct me on how to make text trasnparent. The Text is loctated in my custom buttons. A Sample of my code is below. Font fn = new Font("Tahoma",8, System.Drawing.FontStyle.Bold); string str= "Sauteed Spinach & Bacon"; StringFormat sf=(StringFormat)StringFormat.GenericTy...more >>

Optimizing C# programs for Multi-Processors/ DualCore
Posted by Martin Pöpping at 10/4/2006 1:35:05 PM
Hello, is there a way to optimize loops (f.e. matrix operations) for multi processor systems with C#? I´m searching for something like OpenMP, which is available for C/C++ but not for C#. Or isn´t there any way to optimize it with C#? Do I have to outsource my matrix operation into...more >>

missing fundamentals of updating a database
Posted by michael sorens at 10/4/2006 1:19:32 PM
I have written a few applications to read data from a database but now, = as = I turn my attention to writing to a database, I am apparently missing so= me = fundamentals. I created a new database with a new (empty) table called = Version. I then created a new data source in the Data S...more >>

Invoke
Posted by dani kotlar at 10/4/2006 12:58:13 PM
Is it possible to pass the Invoke or BeginInvoke functions as a parameter a delegate encapsulating a function with a non empty set of parameters? How is it done? ...more >>

C# passing array of data to Excel
Posted by tlinzy at 10/4/2006 12:42:01 PM
I'm converting a VB6 program that passes data (including arrays) to an Excel spreadsheet. I'm having trouble in c# passing the array. I'm getting a type mismatch error. Any ideas? -- Thank You...more >>

Problem with .Net Remoting with threads.
Posted by fAnSKyer/C# newbie at 10/4/2006 12:26:33 PM
My remoting object lanched a thread, and in my server program, I created a remoting object, bind it in localhost, initialize it[start the thread]. This works fine. and In server program where I created the remoting object, I can use method to communicate with the object in Thread. However, If...more >>

Converting Windows C# Application to a Windows NT Service
Posted by Todd Jaspers at 10/4/2006 12:21:02 PM
Hey guys, I've written a fairly simple Windows C# Application using Visual Studio 2005. I have to manually run it, but I would prefer to have it run on it's own, as if it was a Windows NT Service. I am a Delphi convert (still use it for some jobs). When developing in Delphi, I would wr...more >>

Why does this compile?
Posted by Frank Rizzo at 10/4/2006 11:23:20 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Maybe I don't know all the c# quirks, but the code below should be compili...more >>

Date Format
Posted by Bob at 10/4/2006 10:50:28 AM
Hi, I need to convert a string into DateTime. I can use Convert.ToDateTime() however the string can be in different formats like 19700504 or 05041970. Any ideas? Thanks ...more >>

System.Diagnostic.Process
Posted by Macca at 10/4/2006 10:46:02 AM
Hi, I would like to get the memory usage of the process my app is running in so i can monitor levels of memory during runtime. I've been told I can use the System.Diagnostics.Process class to do this. I just want the current process my app is running in and not other processes on the ma...more >>

Old Windows help
Posted by Jon Slaughter at 10/4/2006 10:41:48 AM
Does anyone know where I can find the old help that came, say, with visual studio 6? the one that gave a good overview of windows and win32 api? ...more >>

DataGridView: Skip ReadOnly cells
Posted by osmarjunior at 10/4/2006 10:35:58 AM
I have a DataGridView with some read-only cells. I want it skips these cells when the user press Tab or Shift+Tab keys. How can I do this? Thanks. Junior. ...more >>

Newbie
Posted by Rob at 10/4/2006 9:40:36 AM
I am trying to modify the code below (taken from ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/5a188b50-7170-4069-acad-5de5c915f65d.htm ) to take in another parameter. The class concatenates a list of values using a comma as the delimiter. I want to be able to pass in the delimiter in...more >>

Windows service to run at certain time
Posted by eladla at 10/4/2006 9:22:01 AM
I have a windows service that I want to carry out an action on a certain day of the week at a certain time and if the time is missed for some reason, I want it to be carried out as soon as the service starts again. Any ideas on how to go about this? Thanks!...more >>

Messagebox question
Posted by AMP at 10/4/2006 9:12:11 AM
I want to display a message box when a form displays:Copyright,blah,blah,blah. But I can seam to know where to put it.I tried form load, initialize component. Where does it go? Thanks Mike ...more >>

Tabcontrol tabpage indented canvas
Posted by Rex the Strange at 10/4/2006 8:51:25 AM
I suspect the answer to this question is "you can't," but here goes anyway: I have a tabcontrol which contains, of course, various tabpages (added programmatically at runtime, but this is irrelevent to the question). I've noticed, however, that the actual drawing canvas of the tabpage is not ...more >>

strategy question regarding storing of configuration data
Posted by KarlM at 10/4/2006 8:36:03 AM
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point of view, ini-files are more comfortable to read and edit) Where should I store user specific co...more >>

C# class design
Posted by dmovva at 10/4/2006 8:29:18 AM
Hi all, I am working on a class and having a problem with the design. I have Class2; The columns(properties) of this column are to be determined at runtime. I have gridview control that I want to bind a list of objects of this class to. For example. If I have 2 accounts selected at runt...more >>

DeflateStream.Read() returns zero
Posted by Brent Rogers at 10/4/2006 8:18:03 AM
I am having trouble with the DeflateStream.Read() method. For some reason it wants to return Zero. I have this set of classes: =================== using System; using System.Collections.Generic; using System.Text; using System.IO; using System.IO.Compression; namespace SSNCDataLoad ...more >>

Publish question
Posted by AMP at 10/4/2006 7:57:54 AM
Hello, I am trying to publish a program and I want to include some files, Readme....ect. I tried putting them in the Resourses but that doesnt publish them. How do I make sure they are included and the path to put them? Thanks Mike ...more >>

.NET Framework v2.0
Posted by elena at 10/4/2006 7:44:02 AM
Hi, All I need advice about upgrating VS .NET I have VS .NET 2003 v1.1 installed on Windows XP. I have projectes developed in C#, C++ for desktop applications and C# and ..NET VB for mobile devices targeting Windows CE 4.1 My question is can i upgrate development environment and to make sure...more >>

Create a Socket from a IntPtr handle
Posted by Stuart Ferguson at 10/4/2006 7:07:11 AM
I currently have a service which is written using C++/MFC and this service calls multiple dlls. This service uses these dlls to pass messages to another service via sockets. I am about to write one of these dlls in c# however the service currently passes a handle to a socket created in the se...more >>

File Size
Posted by Doug at 10/4/2006 7:01:37 AM
Hi, It looks like the only way to get a size of a file within csharp is to use FileInfo and the Length property. However that only returns the number of bytes in the file which is translating properly (I have a file that has a size of 1 KB but has 14 bytes in it so the conversion isn't worki...more >>

Intermittent NullReferenceException Error
Posted by tke395 at 10/4/2006 6:51:02 AM
The following code is running in an asp.net application: bool bLogin; try { bLogin = Convert.ToBoolean(Session["UserLogin"].ToString()); } catch { bLogin = false; } ArrayList _roles; try { _roles = (ArrayList)Session["Role"]; } catch { _roles = new ArrayList(); _roles.Add(...more >>

Javascript successful message
Posted by Assimalyst at 10/4/2006 6:19:31 AM
Hi, I want to create a popup to notify a user that the server side process has completed successfully. I intended to use a javascript alert to do this, although ideally the icon should be different, but thats another story . . . Anyway, on successful completion of the process i use this pie...more >>

How do I pass one record, one row to a Method?
Posted by DaBrain at 10/4/2006 5:14:13 AM
Win32 C++/Delphi Developer here moving to .NET C# (Yes, I'm a newbie again) Thank you all for any replies in advance. I am developing a class that accesses a record, one record, and sets the Row values into a Properties, this is of course is based on many conditions, there is a lot of data...more >>

Needs to close the screen automaticaly
Posted by kannan at 10/4/2006 4:55:01 AM
hi, I am writing outlook-addin application using C#. I am trying to import contact information (from text file) in Outlook using C# code. Below is my code. But once data is saved the Contact screen is not closing. I don't want to display any screens. I have tried oCustomContact.Display(...more >>

Does timer interval gets stored anywhere in system or in registry.
Posted by archana at 10/4/2006 3:02:22 AM
Hi all, I want to know about interval of timer. I am using timer in windows service.I head somewhere that when i set interval property of timer while setting interval, restart time of Pc is consider. My question is if i am using timer in my windows service, is there any place where inte...more >>

You're good if you can answer this one.....
Posted by smerf at 10/4/2006 2:51:26 AM
Don't ask why (it'll just make your head hurt - I know mine does just thinking about the screwed up logic my manager has for this little project)......but I need to be able to tunnel a TCP connection through a UDP connection. Any ideas how to do this? I am using VB.Net 2005 but I may be ab...more >>

StreamReader.ReadLine()
Posted by Eddy at 10/4/2006 2:40:02 AM
I have a big problem with streamreader ReadLine()! I read from a long text files about 13k lines, than I encounter a problem: ReadLine() is not anymore able to go on! I have a string whose name is riga, where I put the return value of Readline(), and this is what happens, when I read these thr...more >>

file could not be loaded into the web forms designer -- error
Posted by Carlo3030 at 10/4/2006 1:06:03 AM
Hi, My project's original code works as expected, the problem is after we had added our project to our sourcesafe, my teammate got the latest version and all the pages could not be viewed in the designer. I'm using vsual Studio 2003. below is the exact error: the file could not be lo...more >>

Getting message from outlook
Posted by kannan at 10/4/2006 12:15:01 AM
Hi, I have used Outlook add-in to get the contact list. When this code try to get the email address I am getting following error message box. A program is trying to access e-mail addresses you have stored in outlook. do you want to allow this? How to avoid this message? Please help. ...more >>

Client/server question.
Posted by Visual Systems AB (Martin Arvidsson) at 10/4/2006 12:00:00 AM
Hi! Im developing my first client/server application. So ofcourse i got a cople of questions for you gurus out there ;) Created a simple order/detail, with fields and a datagrid, works excelent. Now, in a walkthru i read in the helpfile it updates the grid in three steps. first it remo...more >>

How to add an array to another
Posted by ad at 10/4/2006 12:00:00 AM
I have a array like: string[] as1={ "Tigher", "Dog", ", "Lion"}; Now I want to make another array as2, which include all items in as1 and add a new item "Wheel". How can I make as2 with code in run time? ...more >>

Decimal Round Up Question
Posted by Tsair at 10/4/2006 12:00:00 AM
I found the decimal round up problem, System.Math.Round(106.865, 2)= 106.86 System.Math.Round(106.875, 2) = 106.88 System.Math.Round(106.885, 2) = 106.88 System.Math.Round(106.895, 2) = 106.9 Why some time it round up the 5 and sometime roun down the 5 ? ...more >>

Trouble finding last line executed with VSNET 2005 before exception occurs
Posted by Ward Bekker at 10/4/2006 12:00:00 AM
Hi, Because of a nasty exception (see below), in some non-managed/non .net com stuff that my application is talking to, my stack trace (also below) does not show something useful. I would like to know what the last called managed code line is before the exception occured. Some tips to fi...more >>

problem windows service with process.start()
Posted by uuyytt at 10/4/2006 12:00:00 AM
I have a Windows service from which I want to start Internet Explorer with a particular URL as an argument. It can work well except when I run it on windows 2003 I allowed services explicitly to interact with the desktop and I tested with imporsonation but still not work. I don't know why ...more >>


DevelopmentNow Blog