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# > january 2006 > threads for thursday january 26

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

Excel => .NET...Grid, Chart
Posted by Niklas at 1/26/2006 11:30:03 PM
Hi We have a lot of applications created in Excel, but now we want to move from Excel to the .NET platform. The application will use grids and charts. What I know the .NET controls are good basic ones, but not suitable in advanced applications unless you create them yourself. Can you recom...more >>


How to store data - binary tree?
Posted by piotrek at 1/26/2006 10:53:02 PM
Hi I would like to ask you a question. Ian creating app. that download from server directory structure ( whole tree ) and those data are placed in proper places into my treeview control. I decided that the most effective way would be : When i connect to the server once, I download the lis...more >>

Child usercontrol contained parent user control does'nt redisplay
Posted by lotus at 1/26/2006 9:53:15 PM
HI All.. I'm realtively new to C#. I have MainForm which includes Parent usercontol, and this parent usercontrol also contains child usercontrol. MainForm --> Parent usercontrol --> child usercontrol Parent usercontol has one button to change the child usercontorl's variable. Child user...more >>

MD5 hashing vs GetHashcode
Posted by MuZZy at 1/26/2006 9:49:01 PM
Hi, Is there any guarantee that MD5 hashing algorithm implementation will not change in the next .NET version unlike what's happened to String.GetHashcode? Thank you, MuZZy...more >>

can you use XmlTextWriter to create HTML?
Posted by John Salerno at 1/26/2006 8:59:20 PM
I thought I might use the XML functions in C# to help me do some repetitive typing in an XHTML file, but I'm stuck. Here's what I have before I just stopped: void WriteXMLFile() { string path = @"C:\elements.xml"; XmlTextWriter xml = new XmlTextWriter(p...more >>

UnBoxing
Posted by wg at 1/26/2006 8:33:31 PM
I am attempting to update a value in an arraylist. However when I updated one element, all elements get updated to the same value. Does anyone know how to achieve this? Here is an example, private ArrayList TagList = new ArrayList(); private void button1_Click(object sender, System.Even...more >>

One of its dependencies is missing! Help!
Posted by Rain at 1/26/2006 8:32:02 PM
AppDomain appDomain = AppDomain.CreateDomain("appDomain", null, null); try { appDomain.Load(@"FF-DeliousDateTimeRequestor.dll"); } finally { AppDomain.Unload(appDomain); } Does anyone know why im getting this exception? "File or assembly name FF-DeliousDateTimeRequestor.dl...more >>

Looking for code to write DOM tree to file?
Posted by TimB at 1/26/2006 7:57:58 PM
What is the fastest and most eleganr way to produce XML files as files from DOM trees? I don't mean any serialization but something that writes all elements and attributes nicely in indentent form into file. ...more >>



Reading result from DB reader
Posted by Jeremy H at 1/26/2006 7:53:06 PM
Hello, What is the nicest way to read Database data from reader objecy after making a SQL query? Do I really need mapper classes with methods like: // Reader is OleDbDataReader object. public int GetInt(string column) { int data = (reader.IsDBNull(reader.GetOrdinal(column))) ?...more >>

Retrieving Application Information?
Posted by Orgbrat at 1/26/2006 7:16:34 PM
Is there a way to retrieve a WinForms application information such as Company, Product and Version from within a class library ( DLL ) that the Winforms application is using. Specificly the applications specfic ApplicationData directory. This is not a problem from within the application, all y...more >>

Generic Collections vs ArrayList
Posted by Dale at 1/26/2006 7:03:01 PM
I read an article sometime in the last few weeks comparing the performance of Generic Collections to ArrayList. It was pretty detailed with several charts comparing various collections methods between the two. I think the article was in MSDN magazine but I can't find it after hours of sear...more >>

generic reset of values for hashtable
Posted by andrewcw at 1/26/2006 6:23:02 PM
I have a reason to resuse hashtables and I'd like to set the values to null without having to reload the keys.- > which is what the clear method does. If I try a foreach construct I get an error that I cannot alter the value. The documentation for using an enumerator and moveNext also have...more >>

Is there a way to test guid string?
Posted by SevDer at 1/26/2006 5:48:19 PM
Is there a way to test guid string? I want to do it without try catch block to save on performance. Thanks in advance. -- SevDer http://www.sevder.com A new source for .NET Developers ...more >>

showing a form
Posted by Ant at 1/26/2006 5:32:03 PM
Hi, this is a simple question. i want to click a button to show a form. If I use this code: button_click() { MyNewForm myNewForm = new MyNewForm; myNewForm.Show(); } every time I click the button I get multiple instances of the form. Understandably. If I move the instantiation of t...more >>

Access a form, using a string literal?
Posted by Gerrit Snel at 1/26/2006 5:14:44 PM
We have a question but we're in doubt if it's even possible or not. The question is as follows: Is it possible to access a form using a string literal, and if so yes? We want to use something like this (don't mind the syntax as it obviously doesn't work): Form("Form1") frm = ("Form1")G...more >>

Windows user name
Posted by Ferdinand Zaubzer at 1/26/2006 4:24:24 PM
With System.Security.Principal.WindowsIdentity.GetCurrent().Name I get the user name of the current Windows user. But how can I get the full name? Thanks Ferdinand...more >>

Preventing wincode on custom control?
Posted by Brett Romero at 1/26/2006 3:50:54 PM
I have a custom control that defines this.AlternatingBackColor = System.Drawing.Color.Lavender; in its constructor. When I add this control from my VS.NET 2003 toolbar and drop it onto a form, the same line of code is generated in the form's InitializeComponent(): this.customGrid.Alterna...more >>

ANN: Free PDF books for registered users of Visual Studio 2005
Posted by Carlos J. Quintero [VB MVP] at 1/26/2006 3:45:33 PM
Hi all, I just wanted to let you know that if you have registering Visual Studio 2005 finally has some benefits. You can get electronic PDF books about Visual Studio 2005 and some other stuff. For example, the updated book "Working with Visual Studio 2005" by Craig Skibo and others (prev...more >>

Call a method based on a parameter
Posted by Peter Kirk at 1/26/2006 3:32:23 PM
Hi there in c# what is a good way of selecting which method to call based on a string? For example, my method can accept a string parameter (there are 50 or so valid strings that can be passed in), and based on this string I should call some other specific handler method. Is there som...more >>

Help with processing xml from an http api return
Posted by mnvikefan at 1/26/2006 3:01:01 PM
What would be the best way to process a return from an http api login function that returns one of the following two XML streams? Successful login with a session ID returned <?xml version="1.0" encoding="UTF-8" ?> <CreateSessionResponse> <result>0</result> <warning>CreateSession succ...more >>

How to Design Delegate Architecture ?
Posted by Joanna Carter [TeamB] at 1/26/2006 2:58:25 PM
Hi folks I think I have asked something similar before, but here goes again... I have to call a method that varies depending on the type of one of its parameters. The object that I have to pass is of a base class. I do not want to have an "if (...) else" construct if I can avoid it. ...more >>

Code run from IDE or from .exe ?
Posted by Marty at 1/26/2006 2:46:07 PM
Hi, Is it possible to detect from the C# code that its main thread is run from the VS IDE or directly from the .exe file (in debug or release) ? This is because I want my Console output to be displayed only when the code is run from the IDE, otherwise it go to a text file. Also, I have ...more >>

overriding method or property in partial class
Posted by john_teague at 1/26/2006 2:36:48 PM
I'm working with a code generator that uses partial classes to generated the basic stuff and leave the other file alone for you to make changes. In the 1.1 version we would inherit from a class and then override a property or method for customization. How would I do this with a partial class...more >>

PLS HELP: HUGE problem with Hashcode
Posted by MuZZy at 1/26/2006 1:52:04 PM
Hi, Why for god sake they change implementation of String.GetHashCode() from ..NET 1 to .NET 2? We were storing some user passwords in hashcode, now we can't upgrade those clients with .NET 2 vesrion of our app as they will not be able to log in. I know, we shouldn't have dealt with h...more >>

Anonymous Method syntax issue
Posted by Joel Finkel at 1/26/2006 1:27:02 PM
Folks, Sorry to take up bandwidth, but for the life of me I cannot see the syntax error in this code: Timer myTimer = new Timer(); myTimer.Tick += delegate { stopWaiting = true; }; The compiler error indicates that the parser is exepcting a "}" at the "." in the second line. Thi...more >>

Comparing Strings
Posted by Jonathan Wood at 1/26/2006 1:12:53 PM
Can someone tell me how to compare two strings using a case-insensitive comparison. Ideally, I would prefer not to have to change a global setting or override any other interfaces. BTW, does anyone know why documentation for .NET library methods don't have a Return Value section where th...more >>

Return whole List from collection class?
Posted by Gustaf at 1/26/2006 12:51:23 PM
I've got a collection class built on System.Collections.CollectionBase, and I want a property that returns all the objects currently in the collection, like this: public Object[] Objects { get { return (Object[]) List; } } This conversion is illegal however. How shall I write inste...more >>

Array element type
Posted by jtougas NO[at]SPAM gmail.com at 1/26/2006 12:40:44 PM
What is the way to the type of an array's elements? Array a = new long[] { 1, 2, 3 }; Type t = a.GetType(); Console.WriteLine( t.FullName ); This will write "System.Int64[]", but is not what I'm looking for. Rather I want the type of the array's elements, so "System.Int64". I seem to remem...more >>

RegistryKey member GetValueNames
Posted by auldh at 1/26/2006 12:12:04 PM
being a novice i searched the net to get help on my c# project. i'm trying to iterate, enumerate, loop through a registry tree hive. for example i have a sub folder under HKLM\SOFTWARE that has some 21 sub folders and there are sub folders under some of he 21. i have no problem going into ...more >>

C# to VB.net conversion for "?" conditionals
Posted by .Net Sports at 1/26/2006 11:54:46 AM
I need to convert some C# ?Conditionals over to vb.net (most likely in vb.net using If..Then statements), but the C#2VBNETconverter by KamalPatel isn't converting them: string PurchaseType = (Convert.ToString(drwData["DailyItem"]) == "True") ? "ID" : "PID"; XmlNodeList Selections = xdcData....more >>

PInvokeStackImbalance was detected.
Posted by John Sudds at 1/26/2006 11:51:02 AM
The MDA appears on the call to OpenDesktop. I have tried a variety of approaches (including specifying the A and W variant with ExactSpelling=true, and PreserveSig=true) but none of them seem to work. This code was copied from a 1.1 sample that purported to work without an error. p...more >>

Structure for extremely large multi-tier Web projects
Posted by Dan Munk at 1/26/2006 11:41:15 AM
Hello, I am working on a very large multi-tier Web application. The application consists of approximately 100 middle-tier/back-end projects and 200-300 presentation projects. Obviously this is too large to manage in a single solution. The development staff have each developed ways to work ...more >>

Sorting & ArrayLists
Posted by MikeY at 1/26/2006 11:39:36 AM
Hi Eveyone, I'm trying to sort my ArrayList, but I'm getting stumped. Hopefully someone can help me out. I'm using C# Windows forms, but Console app for testing. What I am doing is pulling my data from my database and putting the data into an ArrayList. from there I want to be able to sort t...more >>

Question about the split function
Posted by needin4mation NO[at]SPAM gmail.com at 1/26/2006 11:37:46 AM
Hi, I am trying to parse a colon delimited text file. Assume these as examples: Book:mybook Video:myvideo Name:myname When I use this: ReadFromFile("c:\\Inetpub\\wwwroot\\myfile.txt"); } public void ReadFromFile(string filename) { StreamReader SR; strin...more >>

Is there something better than EnumPrinters?
Posted by PyongHopscotch NO[at]SPAM gmail.com at 1/26/2006 10:15:45 AM
Hi All I was just wondering if there was a better function/way to get information on all the printers currently installed than EnumPrinters. I only really need all the printer names but don't care to do the memory management involved with EnumPrinters. I looked at using GetProfileString with [...more >>

How to display second form?
Posted by Brett Romero at 1/26/2006 9:57:40 AM
My application start like this: frmMaster MainForm = new frmMaster(); System.Windows.Forms.Application.Run(MainForm); The flow is that MainForm shows then a SecondForm shows after the user does something. This is an MDI app so SecondForm needs to always be inside MainForm. There are times...more >>

com interop v2003
Posted by E.Sh at 1/26/2006 9:37:04 AM
I am using c# in v2003. created cominterop. running on the development computer, no problem to access it via COM. when trying to install it on a w2k server: 1. regasm /codebase .tlb: , OK. 2. gacutil /i. OK. 3. Oleview displays it. bur create instance fails with 'can not find file". Wh...more >>

Can I change my setup according to the configuration
Posted by Dave at 1/26/2006 9:05:06 AM
I'm sure this must be really simple but I can't find it. I have a setup/deployment project and I want to include a particular program (ie. a primary output) in the debug configuration but not in the release configuration. Can anyone tell me how to do it. -- Dave...more >>

native dll access error - Attempted to read or write protected memory
Posted by hiralparikh NO[at]SPAM gmail.com at 1/26/2006 8:32:19 AM
Hi, I am using .NET 2.0 and trying to use a function from a native DLL file. Here is the syntax that I am using: definition: [DllImport(@"old.dll", EntryPoint="#1")] public static extern String getPwd(String strServerName, String strUserId); Call: string pwd = getPwd("servername",...more >>

Question About an Event Hook
Posted by needin4mation NO[at]SPAM gmail.com at 1/26/2006 8:04:54 AM
Hi, had a question about event hooks. I don't know that much about it so please forgive me if I don't use all the right words. Is it possible to use a hook that listens or watches a certain directory/folder and when a new file is put into that directory take some action. I have a third part...more >>

Using Type.GetType in an already loaded assembly
Posted by TN at 1/26/2006 7:45:06 AM
I have an application that is using System.Windows.Forms. I'd like to use Type.GetType() to get a Type so I can create an instance of it using reflection. The only way I can get it to return the type is: Type tt = Type.GetType( "System.Windows.Forms.TextBox, System.Windows.Forms, Version=2...more >>

How to convert object[] to char[] ?
Posted by tienlx at 1/26/2006 3:57:09 AM
Hi all, I'm have a problem that i don't know how to convert object[] to char[] in C# . Does anybody know ? Thanks. ...more >>

Drawing Pixels
Posted by Chris Saunders at 1/26/2006 2:28:08 AM
I am fairly new to .Net and C# but am familiar with the Win32 API. I wish to set the pixels of the client area of a window one at a time with a specific color. I have so far discovered that System.Drawing.Bitmap has a SetPixel() method but I can't seem to find out how to have the bitmap display...more >>

Reading a struct, field by field
Posted by Sadeq at 1/26/2006 1:41:51 AM
Is there a way to read a struct field by field? I want to write a rather general function, like: public string EncodeStruct (struct strct) { .... } which accepts a general struct type, reads it field by field, encodes each field depending on its type (i.e. an integer field is encoding i...more >>

Create a DataView of Distinct row from a DadaTable
Posted by Li Pang at 1/26/2006 1:29:02 AM
Hi, I want to know how to create a dataview from a datatable of DISTINCT data. Thank in advance...more >>

How to convert a string to a GUID
Posted by Wolf at 1/26/2006 1:28:23 AM
Hi I am trying to set a property(PartyHomeAddressID) = to a guid in a ini file. But everytime when the ini file has an empty guid it breaks with an error tellin me a guid is 32 char long with 4 dashes. client.PartyHomeAddressID = new Guid(contact.Substring(1542, 36).Trim()); If its no...more >>

Marshal.PtrToStructure throws ArgumentException
Posted by Jay at 1/26/2006 12:38:12 AM
Hi, In my application, C++ dll is posting some message,which is processed by a form in C# ,where I use Message.Lparam to convert it in structure using Marshal.PtrToStructure() mehtod ,but it throws ArgumentException. can anybody give sample code for Marshal.PtrToStructure() . ...more >>

interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
Posted by Wiktor Zychla [C# MVP] at 1/26/2006 12:00:00 AM
Following code was supposed to sort an ArrayList of strings while keeping one "fixed" element at the last position. However, the code hangs in .NET 1.1. I think that answering these questions should be an interesting and instructive task for .NET learners: 1. why the code hangs in .NET 1.1? ...more >>

Nullable types in a constructor?
Posted by Steven Livingstone at 1/26/2006 12:00:00 AM
Bit of advice here folks. I am creating a default constructor that just initializes a new instance of my object and a secon constructor that takes an ID and loads an object with data from the database for the given ID. I could just leave two separate constructors, or i could just have the d...more >>

databinding and updating sample
Posted by Grant at 1/26/2006 12:00:00 AM
I need some sample code showing how to manipulate data in my access database using C#. This is what Im trying to do: Dropdownlist with datagrid both bound to datasource. When the drop down list value changes - the datagrid values change accordingly. I managed to get this working by setting ...more >>

How to use membership without Login Controls
Posted by ad at 1/26/2006 12:00:00 AM
I have create a custom membership provider. The common usage of custom membership is set it as default Membership Provider win web.config, and use login controls with it. How can I use custom membership provider without Login Controls? For example, the name of my custom membership provider...more >>

Can someone help me
Posted by Chi at 1/26/2006 12:00:00 AM
what is the "unable to write data to the transport connection" I use the oreilly , programming c# using System; using System.Net.Sockets; using System.Text; using System.IO; // get a file name from the client // open the file and send the // contents from the server to the client public c...more >>

implementng sliding window
Posted by Lonewolf at 1/26/2006 12:00:00 AM
Hi, does anyone know of a way to do sliding window similar to WMP 9's slider bar which can slide up when the mouse gets to the bottom of the screen in fullscreen mode during playback. Basically I'm trying to achieve the same effect in my directshow program done in C# via managed assembly. ...more >>


DevelopmentNow Blog