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 2006

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

Get all data from one row in listview
Posted by Lars Erik Nes at 5/31/2006 11:23:01 PM
Hi all. I have a small problem. I have a listview which contais 4 columns. (No. / Desc / Contract / Product). other properties to this listview (lvActivities): lvActivities.View = View.Details; lvActivities.FullRowSelect = true; lvActivities.HideSelect...more >>


releasing general heap memory allocated to a large array
Posted by johnmann56 at 5/31/2006 10:34:01 PM
Hello. I have a small C# program which uses a number of large arrays of double. The program runs fine on my desktop PC which has 2 GB of memory, but when run on my laptop with 512 MB the laptop practically freezes up, from running out of memory. I would therefore like to modify my program so t...more >>

Tool to find the unused methods and members in an assembly
Posted by Venkat at 5/31/2006 7:59:03 PM
Hi, My application is splitted into more than one assembly. And I want to clean up the methods which are not called or not used among any of the assemblies. Can any one suggest me the tools available to find and remove the un used methods or members? Thanks in ...more >>

Readers and Writers
Posted by Karch at 5/31/2006 6:49:07 PM
Can someone give me the one paragraph answer to when and why I should use each of the following classes (versus each other): StreamReader/Writer StringReader/Writer TextReader/Writer BinaryReader/Writer The first two, in particular, seem to do much of the same thing and both work with c...more >>

Class Object and override
Posted by Tony Johansson at 5/31/2006 6:44:38 PM
Hello!! You may correct me if I have made any wrong assumptions. Below I have some simple classes. When you have this t.ToString() below it's the ToString() method in Object class that is called and when you have this t.GetType() below it's the GetType() method in the Object class that i...more >>

Getting CF_ENHMETAFILE from clipboard
Posted by Andrey Dzizenko at 5/31/2006 6:25:15 PM
Hi all! Did anyone try the subj? I use extern IsClipboardFormatAvailable and GetClipboardData from = user32.dll. IsClipboardFormatAvailable(14) returns true, but = GetClipboardData(14) returns null-pointer after that. I found working source codes that can get CF_ENHMETAFILE from c...more >>

strange c# - vb difference
Posted by Tina at 5/31/2006 6:16:13 PM
I'm using 1.1/vs.net 2003 ... C#example.............. string myPath = Server.MapPath(".\\Data\\" + (string) Session["LogoFileName"]); Produces this value in myPath ?myPath @"c:\inetpub\wwwroot\CSharpCustomers\Data\GaryRocks.jpg" VB example............. Dim myPath As String =...more >>

Navigating by attribute in XPath
Posted by jon cosby at 5/31/2006 6:00:21 PM
This code shows all values for the config node. I'm trying to retrieve the value for systrayenabled for attrib "jon". Something wrong? sXmlPath = Application.StartupPath.ToString() + "\\settings.xml"; XmlDocument xmlConfig = new XmlDocument(); xmlConfig.Load(sXmlPath); XPathNavigator navig...more >>



Bell Character
Posted by Josh at 5/31/2006 4:57:04 PM
I want to get the ASCII Bell character (7) as a string. How? I'm pulliing my hair out over the stupid little task. HELP!!!!!!!!! ARRRAGGH! -- #####-----#####-----##### POV Tips and Hints at ... http://povman.blogspot.com/ ...more >>

dealing with unsigned char* from C++ .lib
Posted by Stephen Cawood at 5/31/2006 4:30:18 PM
I'm trying to use a C++ .lib from C# (I tried the Interop group will no results). I have a working wrapper DLL (I can get back simple things like int), but I'm having issues dealing with an array of bytes. For example, the .lib contains this function: int create(int id, int scale, unsign...more >>

string to bitmask
Posted by Just D at 5/31/2006 4:23:15 PM
All, What's the easiest way to convert the string like 1001010101101010101 into a binary mask of type Int64 and back? ConvertBitmask or something like that? Just D. ...more >>

Why is LinkedList lacking so much?
Posted by Steve at 5/31/2006 4:18:40 PM
I just realized that I need elements in my List<> to be doubly linked. So I searched for "C# Linked List" and found the LinkedList<> class. I was happy until I looked at the docs for this class and realized that it's missing so much. For example, Find(predicate), operator[], etc Is there...more >>

How do I convert a FileInfo.Attributes to a SqlDBType
Posted by Greg Larsen at 5/31/2006 4:08:01 PM
I'm trying write a SQLCLR that returns FileInfo.Attributes property to SQL Server in a record set and I am getting the following error. cannot convert from 'System.IO.FileAttributes' to 'System.Data.SqlTypes.SqlInt32' How can I convert the Attributes to display an integer value. Clearly t...more >>

ReferencedAssemblies and the gac
Posted by Thomas W. Brown at 5/31/2006 2:56:01 PM
I'm dynamically compiling some code and adding needed referenced assemblies. When I add references to DLLs using an absolute path there is no problem. When I add *relative* references to the system DLLs there is, again, no problem. But when I try to add a *relative* reference to 3rd party m...more >>

Missing the benefit of DataSets with Crystal 10 with process reload on Next|Previous button activiation
Posted by dekern at 5/31/2006 2:46:08 PM
Good afternoon all, I guess I am missing the benefit of using datasets with Crystal. For years I have written wrapper apps that used the Pull method and I let Crystal do all the sql work. Now I have an issue where the queries run for 4+ minutes so I don't want Crystal doing repeated legwork....more >>

Problems with RichTextBox.Rtf
Posted by Flack at 5/31/2006 2:11:02 PM
Hey guys, I'm trying to set the Rtf property of a Richtextbox and I'm having some issues. First I do this, which works fine: string test = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\ul\f0...more >>

How to Get Server Reboot Time?
Posted by samtilden NO[at]SPAM gmail.com at 5/31/2006 2:09:50 PM
I am writing in C# .NET and am using System.Environment.TickCount (32-bit integer) to get the number of milliseconds since the server was rebooted. The problem is that the server has been up for over 30 days and the 32-bit integer is coming back negative. Of course, I can extend it with zero...more >>

Deserialization with a removed class
Posted by Joe at 5/31/2006 2:01:03 PM
Hello all! I'm trying to deserialize an object which has a few members which no longer exist. Is there anyway using a custom binder to remove the reference to these objects or just return a null? Thanks, Joe ...more >>

System.Math.DivRem for compact framework
Posted by muzilli NO[at]SPAM sercomtel.com.br at 5/31/2006 1:52:49 PM
Howdy all, what is the same DivRem function for Mobile development. I'm using the ..NET compact framework. Thanks all, Marcelo Muzilli ...more >>

Can anyone tell me of any optimations I could do to this to make it faster?
Posted by (Extremest NO[at]SPAM extremest.com) at 5/31/2006 1:52:18 PM
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All I am doing is quering the db for all the headers for a certain group and then going through th...more >>

How to compile resource files via Nant?
Posted by Brett Romero at 5/31/2006 1:40:50 PM
I am compiling a winform app using nant. I first compile via VS.NET, which generates *.resource files in obj\debug. Then I use the <resources> tag in the Nant script to complete a build via Nant. I did try the Nant build by accessing the *.resx file instead. The app throws this error when I...more >>

Unable to load (unmanaged) dll
Posted by Richard NO[at]SPAM nospam.nospam at 5/31/2006 1:31:03 PM
Hi All, Any ideas on how to resolve the run-time exception: "Unable to load DLL 'EventMgr.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" It's raised when my app calls a static function in the dll. In my app I have: [DllImport("EventMgr.dll", EntryPoi...more >>

A question about Exception
Posted by tony at 5/31/2006 1:23:32 PM
Hello!! As you know every user defined exception must be derived from class Exception. Now to my question if I write catch then every exception will be caught. If I instead write catch(Exception) then every exception will also be caught. These two will catch the exact same exception is t...more >>

A question on RighTextBox ...
Posted by Polaris at 5/31/2006 1:20:53 PM
Hi: Is there a way to tell exactly how many chars a RichTextBox can display (no scroll bars)? The Font used may not be fixed width font. Thanks in advance! Polaris ...more >>

ASP.NET/Crystal Reports Deployment Question
Posted by wtistang NO[at]SPAM hotmail.com at 5/31/2006 1:10:39 PM
I developed an asp.net/crystal app in my local machine using the crystal reports which comes with VS 2003. Now I am planning to deploy it to a web server which support asp.net and crystal reports (version 9). What steps I should follow to make a successful deployment? Thanks in advance. M...more >>

Encoding string for xml
Posted by Mantorok at 5/31/2006 12:31:17 PM
Hi all I have a plain text string, sometimes the string will contain special characters, how can I encode this string in xml format? Thanks Kev ...more >>

C# COM array issues when accessed through vbscript
Posted by Edvin at 5/31/2006 12:04:01 PM
Greetings, I'm trying to access C# COM object from a VBscript, where C# will modify the reference parameter to an array. I found simple reference parameter datatypes (i.e. int, string) yield to expected result, however, when I try to create an array of these primitives, I encounter strange ...more >>

Books about SW Design/Architecture
Posted by Ludwig Wittgenstein at 5/31/2006 11:30:26 AM
Other than the Design Patterns book, which book(s) is/are the best to learn object-oriented software design/architecture from ? ...more >>

Bit shift question.
Posted by Ken Varn at 5/31/2006 11:26:01 AM
I am seeing a discrepancy on how bit shifts work in C# vs. C++. In C++, if you do a bit shift and it overflows, the bits are lost. i.e. in C++, -1 << 32 would produce 0. However, in C#, this same expression yields -1. Is there anyway to have C# bit shift behave like C++? -- ------...more >>

return inside of using block
Posted by Andrew Robinson at 5/31/2006 11:13:26 AM
Are these two equivalent? Is one better than the other? I tend to go with #1 but started wondering.... Thanks, 1: using (SqlConnection cn = new SqlConnection(DataConnection)) using (SqlCommand cm = new SqlCommand("ItemCount", cn)) { cm.CommandType = CommandType.StoredProcedure; ...more >>

background worker and win forms
Posted by bilosta NO[at]SPAM gmail.com at 5/31/2006 11:10:40 AM
I need help with background worker and form I have a class (form1) that works with database. I need this: -Show form2 while form1 is geting data from database -When form1 is done, close form2, proced working form1 I try these things with thread but a can not do it I try it with background w...more >>

Sockets Problem when converting winsock vb6 to c#
Posted by Dave at 5/31/2006 10:41:02 AM
Hi. I have an application that uses sockets, as per below: m_clientSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ); int iPortNo =8000; IPEndPoint ipEnd = new IPEndPoint (ip,iPortNo); m_clientSocket.Connect ( ipEnd ); It works fine,...more >>

Validators Stopped Working When App Moved To New Server
Posted by Ben at 5/31/2006 10:30:02 AM
Hello I recently used VS.NET 2003's Copy Project to create a "release' version of my asp.net app. On the same machine where the development has occured, I loaded the app and all worked fine. I then copied all the files to our production server and began testing the application there. So fa...more >>

Fetching data from SQL Server
Posted by Jenden0 NO[at]SPAM gmail.com at 5/31/2006 10:24:29 AM
I'm new to C# (and Microsoft in general) so this may be a simple problem, but I haven't been able to figure it out yet. I've got a database with a number of different tables and I want the user to be able to select which table they want, then have that table pop up in a datagridview. I've fig...more >>

Passing values between forms
Posted by lextendo NO[at]SPAM gmail.com at 5/31/2006 9:13:54 AM
Hi all, I have a problem which seems it has to have a simple solution, though I can't figure it out and I can't find a solution on usenet either. Two forms: Form A contains a textbox where the user can enter a date. When doubleclicking the textbox, a form B wil open with a CalenderControl t...more >>

How can WaitOne hang when used with a timeout?
Posted by Ed Sutton at 5/31/2006 8:37:48 AM
Can any one please offer any theories on how ManualResetEvent.WaitOne can hang when used with a timeout? When I notice my USB/Serial devices are no longer receiving communications, I hit break all, and one of the threads is hanging at: bool replyReceived = readerCommand.SignalReply.WaitO...more >>

Form.ActiveForm for C# control on a VB 6 form
Posted by ramhog at 5/31/2006 7:17:43 AM
Hello all, I have a C# control that is housed on a form that was created in VB 6. There are some activities I want to do only if the control is on the ActiveForm. However, since the form is a VB 6 form when I call Form.ActiveForm I get a null back, even though I can see the form is the active ...more >>

What's happended to ANSI chars 135 and 130 - ToString/GetBytes
Posted by gizmo at 5/31/2006 6:58:35 AM
Hi, Here's a little hack I put together to try to get to the bottom of a problem I'm having with trying to base64 encode a hash value. The hash value contains character codes 135 and 130 amongst others. This snippet will set up a string of chars 190, 135, 130, 73, 242, 243, 10. It puts th...more >>

String array in constructor
Posted by mattias.k.nyberg NO[at]SPAM gmail.com at 5/31/2006 6:32:23 AM
So Im trying to learn to program with C#. And I have this question about why the string array won't work in the first class but it does in the second. To me it looks like they do the exact same thing. class Test { string[] words; public Test() { words = { "", "", "" }; // This doesn'...more >>

phone number regular expression problem
Posted by venu at 5/31/2006 6:27:43 AM
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should accept any number of numbers # any number of - hyphens # and one + symbol # no other charac...more >>

Phone number regular expressions
Posted by venu at 5/31/2006 6:23:54 AM
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should accept any number of numbers # any number of - hyphens # and one + symbol # no other charac...more >>

Help on register a client script using a Web Custom Control
Posted by lourivas at 5/31/2006 5:31:17 AM
Hi, I create a class with a property called MyProperty that needs to register a client script if the value is set to true. When i change the property value to true i always receive a message "Property value is not valid/Object reference not set to an instance of an object". I'm using VS 2005. W...more >>

Performance issue (bug?) with .NET 2 ListView
Posted by mrshrinkray NO[at]SPAM googlemail.com at 5/31/2006 5:00:51 AM
Are there any know bugs with the ListView in .NET 2? I'm having problems with an application that takes 15 seconds in 1.1, and now takes over a minute. The code in question uses: listViewItem = this.listView1.Items.Add(...) followed by 7 calls to listViewItem.SubItems.Add(...) When I c...more >>

Error in form designer
Posted by osmarjunior at 5/31/2006 4:38:27 AM
I have a form that is not appearing like it should, in designer mode. It appears that is some problem with an image in my toolbar. It shows the following error: The type 'MyProject.Properties.Resources' has no property named 'Assistencia'. In my case, "Assistencia" is an image in my ToolB...more >>

Array/ArrayList/Genreic List Threadsafe
Posted by Macca at 5/31/2006 2:29:01 AM
Hi, I need a data structure such as an Array/ArrayList/Generic List to hold multiple instances of a user derfined class. This array will be accessed across multiple threads. However I dont want to lock the array itself as this will cause poor performance due to the array being accessed f...more >>

Signing a CAB file
Posted by Nadav at 5/31/2006 1:26:01 AM
Hi Guys, This should be something simple or not possible at all, I have a ‘.pvk’ file and I want to generate a corresponding .spc file, I have followed the instructions on http://msdn2.microsoft.com/en-us/library/9sh96ycy.aspx but failed to generate an adequate cet/spc file, following a...more >>

TrackBar with transparent background
Posted by _DD at 5/31/2006 1:09:54 AM
Not sure why you can't get transparent background with a TrackBar control. Is there any way around this? I've searched for info, but mostly found other people looking for a transparent TrackBar. ...more >>

web.config and xml auth
Posted by Jessica Weiner at 5/31/2006 12:53:13 AM
I have a web.config file which defines different users who can login into the website. After a successful login, the user gets to a page with a javascript menubar at the top. The menu bar needs to be customized according to the "rank" of the user. So for some users, some menu options will not ...more >>

The parameter 'exePath' is invalid in ConfigurationManager.OpenExe
Posted by fran at 5/31/2006 12:50:01 AM
I have this code: System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration("SAS.Int.ComunServicios.ComunProcesos.dll"); The filepath is not useful for me. If I want to use an absolute path like: System.Configuration.Configuration config = Configuratio...more >>

how do i do this....
Posted by deepaks911 NO[at]SPAM gmail.com at 5/31/2006 12:41:55 AM
Hi i'm working on chat application in .net , i want to add whiteboard feature in the same project. The whiteboard has been made, but i am clueless about how to share the whiteboard among server and clients,. If any body writes on the board then that must be conveyed to all the connected client...more >>


DevelopmentNow Blog