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 > threads for tuesday may 9

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

How to convert ArrayList to Array
Posted by None at 5/9/2006 11:28:49 PM
Hi, How can we convert ArrayList to Int[] (i.e., Integer Array). If anybody knows the solution pls let me know. Thanks and Regards, Vinothkumar B ...more >>


Remove the element from array
Posted by None at 5/9/2006 10:42:11 PM
Hi, I have declared array as Int[] ids = new int[50]; In ArrayList we can remove specified index using RemoveAt(5) method. My question is how can we do this one with int array (single dimensional array) or else is there any alternative solution for this? If anybody knows the sol...more >>

Instance Variable in Static Method
Posted by thomson at 5/9/2006 10:00:14 PM
Hi All, In a Singleton pattern , if we create an instance variable, and return it, whether this one also be a static variable , Can anyone give me insights on the Memory allocation Thanks in Advance thomson ...more >>

Strong name Error
Posted by John Skinner at 5/9/2006 9:32:01 PM
I am using C# in VS2005 and trying to make use of the "Data Access Application Block" version 2 I have created a small test application that to do the testing. If my application and the Common, Object and Dat modules are not signed DAAB runs OK but as soon as I sign them I get the fo...more >>

design question: how to organize your toolstrips
Posted by Rudderius at 5/9/2006 9:31:38 PM
Hey, I'm working on a winform app in VS 2005. I'm wondering if someone knows some best practices on how to organize the toolstrips. I have a menuToolStrip and some other toolstrips. As in many apps, the functionality of the toolstrip en the menubar overlap. (e.g. cut & copy etc) The com...more >>

How to...
Posted by Jacek Jurkowski at 5/9/2006 9:30:36 PM
.... set default value for SQLSercer Table Column of type Byte[] (c#) and Image (SQLServer)? ...more >>

anybody can help me
Posted by jack at 5/9/2006 8:39:16 PM
Hi,dear friends: I want automation Excel in VSTO, when the user minimize excel window i want change the interface in my add-in. But Excel Com haven't provide this event,how can i achieve this. thanks! ...more >>

How to use GetStream from ResourceManager?
Posted by ad at 5/9/2006 8:02:28 PM
I have an Excel file save in the MyResource.resx. I have to load the Excel file into strem. I use the code: ------------------------------------------------------------------------------------------ ResourceManager a = new ResourceManager("WillNs.MyResource", Assembly.GetExecutingAssembly()...more >>



Windows UserControl not displayed in remote IE
Posted by Gugale at Lincoln at 5/9/2006 7:10:14 PM
I have created a user control and placed the dll file in a virtual directory. I am using the control in a webpage (aspx). On the web server I am able to view the control in IE. However, on remote machines I just see an empty outline. What could be wrong here? Thanks SG ...more >>

How to transfer file in .resx and transfer to Strem
Posted by ad at 5/9/2006 6:22:14 PM
I wnat to load a file in an .resx file and transfer the file to a stream. How can I do? ...more >>

maximum string length in c# and .net
Posted by fawcett NO[at]SPAM gmail.com at 5/9/2006 6:03:40 PM
Hi, Having read this article: http://www.codeproject.com/dotnet/strings.asp?df=100&forumid=13838&exp=0&select=773966 I got curious about the limit of string lengths, so I wrote this program: public static void Main(string[] args) { StringBuilder s = new StringBuilder(); String a...more >>

Shouldn't Dispose method get called automatically?
Posted by Zen at 5/9/2006 5:58:51 PM
Hi, Would anyone know why the .net language would just issue calling the Dispose method to all objects going out-of-scope if they implement IDispose. In another word, if the "using" statement is implicit and automatic for all scope then it would resolve many unmanaged resources leaking or u...more >>

Connecting to MSSQL without a database
Posted by no0obster NO[at]SPAM gmail.com at 5/9/2006 5:54:26 PM
Hello, I'm writing an application that should create a SQL Server 7 database if it doens't exist. i'm using the System.Data.SqlClient objects to connect and run queries. My connection fails to the database because the database doesn't exist. Can the connection string (ConnectionString) be...more >>

session object reinstantiated every time page is refreshed
Posted by cyberbless NO[at]SPAM gmail.com at 5/9/2006 4:38:19 PM
I'm creating a basic page like the on below. Problem is evertime I refresh the page or spawn a "child window" out of the pre-existing browser the Session object is recreated with a new sessionID. Am I doing something wrong? is it possible it could be the hosting company? Any suggestion would ...more >>

Concept of Indexer
Posted by Nash Alexx at 5/9/2006 4:29:02 PM
Hello! I am quite new to C#, and one concept that really gives me a headache is "indexer". I have gone through the MSDN examples, and, at some level know how to use indexers. But, the thing is I do not understand the specification that says something along this line "with indexers you can i...more >>

How to dispose of ArrayList of IDisposable elements
Posted by chrisaotto NO[at]SPAM yahoo.com at 5/9/2006 4:17:26 PM
I have a three part question concerning the proper use of Dispose -- specifically when I have a collection of elements (contianed in an ArrayList) that each implement the IDisposable interface. First, if my class declares disposable members, then I must also implement IDispoable. Is thsi corr...more >>

TreeView and Frames...
Posted by Dan Bass at 5/9/2006 4:17:17 PM
Using: ASP.Net 2.0 C# for code behind I'm slowly migrating a project into the .Net realm from ASP. One of the first things I've been asked to do is replace a tree navigation control (java applet), with the ASP.Net TreeView. The tree resides in a frame, and when a link is clicked, has to ...more >>

isnumeric keyword
Posted by Vikas Kumar at 5/9/2006 3:42:44 PM
For Each item In Request.Form If IsNumeric(item) Then Try Approved(item) Catch ex As Exception Response.Write(ex.Message) End Try End If Next this is code in vb.net to g...more >>

?? Using String.Format() for a MAXIMUM Length ??
Posted by Alan Foxmore at 5/9/2006 3:28:18 PM
Hello all, Is it possible to use String.Format() to specify a maximum length for a formatted item? For example, let's say I have: String.Format("{0}", "FREDDY"); How can I specify that the result of the formatting should be a string no longer than, say, 3 characters? I know I can easily...more >>

Insert Row in Datagrid
Posted by vynerd NO[at]SPAM gmail.com at 5/9/2006 3:23:38 PM
Hi, I am trying to let the user add a row in the datagrid and enter in the data. The new row shows up, but the user cannot edit it. DataTable dt = (DataTable)grid.DataSource; DataRow dr = dt.NewRow(); dt.Rows.InsertAt(dr, grid.CurrentRowIndex); dt.AcceptChanges(); Also, I cannot delete...more >>

Excel - Database
Posted by Kuldeep at 5/9/2006 3:00:47 PM
Hi All, Can anyone give me some leads towards uploading the excel file contents into SQL Database Regards Kuldeep ...more >>

Getting Type information about a Class ?
Posted by vivekaseeja NO[at]SPAM gmail.com at 5/9/2006 2:56:58 PM
Hi, Is there a way to know if a class inherits from a particular interface using Type information and reflection ? Thanks in advance .. ...more >>

Crystal report shows up empty
Posted by Dentharg at 5/9/2006 2:39:40 PM
Hi! I've created an C# project, added DataSet and created a table adaptor (WorkerClothesReport). I've created several GetData() functions and can preview their output. Next, I've created a Crystal report with WorkerClothes as data input. In my main window I've added report viewer and in...more >>

Windows Intergration
Posted by Lee at 5/9/2006 2:05:45 PM
Hi, How do you integrate an application into windows, for instance right clicking a file on the desktop or in a folder brings up a menu of things you can do (delete, rename, send to..) I wish to add my application to this context menu. thanks in advance ...more >>

Modify Read-Only ID Property
Posted by rob at 5/9/2006 1:42:08 PM
Here is the scenario. I have a manager class that accepts objects of a given base type. When I want the object to be processed by the manager I pass it to the manager which then assigns an ID to the object passed in. The user can then retrieve that ID. The problem is that the manager must be a...more >>

Headless application
Posted by Ole at 5/9/2006 1:28:54 PM
How should I write a headless application for a CE 5.0 Compact Framework v2 device and what should I beware of? An example e.g. is highly appreciated. Thanks, Ole ...more >>

How to use the value in .resx
Posted by ad at 5/9/2006 1:09:22 PM
Hi, I have add a value(name String1) into Resource1.resx. How can I refer it in code? ...more >>

Advanced RegEx (the cluster problem).
Posted by skavan at 5/9/2006 1:02:59 PM
Use Case: We have music files that describe, in their filename, attributes of the music. We do not know a general pattern that applies to all filenames -- but we do know that filenames that are clustered together (by for example directory) will, most likely, have the same filename pattern. H...more >>

Dll using Assembly.LoadFrom
Posted by marlos at 5/9/2006 12:58:52 PM
Hi, I would like to know if it is possible to call a dll written in C# (.NET 2.0) from an app written in C# (.NET 1.0). I tried to do this but I received an execution error saying that my dll is incompatible ("version 2.0 is not a compatible version"). I also would like to know if it is pos...more >>

Advanced RegEx (pattern clustering)
Posted by skavan at 5/9/2006 12:50:39 PM
Hi, I'm just wrapping my head around regex and am pretty sure it can do the task at hand - but it's too complex for my brain to process -- so am throwing it out there for you experts to comment on. I am posing two questions. In the interests of space and focus, I'll post a separate thread for...more >>

long process
Posted by Peter Kirk at 5/9/2006 12:40:53 PM
Hi I have an asp with a single button. This invokes a method in one of my classes which performs a terribly long process - can take 15 or 20 minutes. What is the best way to handle this sort of situation? If I just call my long method then the browser eventually times out. Can I start a thr...more >>

Discovering the assembly names in your project ?
Posted by vivekian at 5/9/2006 12:18:41 PM
Hi , Just wondering is there a simple way to extract the names of all the assemblies placed in your bin folder ? thanks in advance.. ...more >>

sql partition
Posted by Dave at 5/9/2006 12:10:02 PM
In SQL 2000, I have paratitioned the data. I have a view that unions the tables to gether. Is there a way to update the records or add a record without having to write code to figure out which paratition the record needs to go in....more >>

System.Net.Mail.SmtpClient is slower
Posted by maflatoun NO[at]SPAM gmail.com at 5/9/2006 11:59:02 AM
Hi everyone, I'm coverting some of our code here from the old way of send email in ..net 1.1 to the new .net 2.0. However, everyone I switch the code the new method there is a delay of 1-2 minutes before an email is sent (this is on my local computer point to my local smtp -> localhost). Anyo...more >>

Bringing C++ code over to a C# project
Posted by Rob at 5/9/2006 11:55:02 AM
Well I'm sure most of you guys that converted from C++ to C# had this problem: how can I bring my C++ code over? (in my case it would be much to difficult to rewrite it) I need to bring over a few classes and structs. Being a complete beginner to C#, almost everything I read on the subject ...more >>

How to call oracle function to get returned boolean type
Posted by John at 5/9/2006 11:49:02 AM
My application needs to call Oracle function using oracle client 9.2. The oracle function returns boolean value from its returned parameter. The name space that I used is system.data.oracleclient. found out there is no boolean type in Oracle parameter in OracleType. How can I get the returned ...more >>

Sync. socket client and server example
Posted by Ole at 5/9/2006 11:41:24 AM
Hi, I'm going to develop a socket communication between an instrument (running CE 5.0 with Compact Fraework V2) and a PC. As the instrument should only connect to one PC at a time I believe that the sync version of the socket should be the easiest - or what??? (please tell if I'm wrong). ...more >>

Tired of this datagridview error for 3 weeks. Need Help!!!
Posted by Dave at 5/9/2006 10:52:02 AM
I have a datagridview which is linked to a table which has 3 fields with the primary key being an autoincrement (tinyint). I use the wizard to create sqldataadapter, dataset and datagridview. Now when I try to enter second row, I get error : "PrimaryKey1 cannot be null". (Primarykey1 is the na...more >>

Registring as COM
Posted by Mantorok at 5/9/2006 10:45:48 AM
Hi all I have a class in C#, and I want to expose it as a COM DLL for use in an ASP page. Any ideas? Thanks Kev ...more >>

With - End With
Posted by Vik at 5/9/2006 10:40:30 AM
Is there in C# an analog of the With <some obj> - End With construction of VB? Thanks. ...more >>

xml "file handle" to share
Posted by phl at 5/9/2006 10:25:52 AM
hi, I have created nice factory/product classes to parse a big xml file and create a custom obj. i plan to instantiate the opening of the xml file in the factory and have the actual parse code in the product classes. So several "products" are going to use the different sections of the XML fil...more >>

Queue<> implements ICollection but not ICollection<>?
Posted by Dave Booker at 5/9/2006 10:22:02 AM
Am I missing something here? It looks like the generic Queue<T> implements Enumerable<T> and ICollection but not ICollection<T>. (I want to use it in an interface that wants an ICollection<T>.) Is there a reason for this, or is it just an oversight in .NET 2.0? Is there a computationally...more >>

How to check status of scheduled job
Posted by das at 5/9/2006 10:10:52 AM
Hi all, I have 2 jobs running windows apps (C#) scheduled on windows scheduler. There is a dependency with this, the second job cannot start until the first job finishes running. Both the jobs run the same app but with different parameters. Please give me some ideas on how to do this, whe...more >>

Cannot insert certain characters in SQL Server
Posted by jcsnippets.atspace.com at 5/9/2006 9:57:50 AM
Hi everyone, Recently I have posted a question regarding special characters in text files. I was trying to read the text file to process the text later on, but I was using the wrong encoding. The correct encoding turned out to be extended ASCII (850). But now I'd like to store the result...more >>

Select an item from listbox using keyboard
Posted by Melson at 5/9/2006 9:50:54 AM
Hi Can anyone give suggestions please. I need to create a list (probably using listbox) and fill with names in the listbox. When I enter a name (maybe Adam) in a program (notepad, MS words, other program), the list of names appear. How can I select the name in the listbox with the keyboa...more >>

Setting transparent colour of image
Posted by Dylan Parry at 5/9/2006 9:46:09 AM
Hi, I've got a byte array containing some image data, and I am writing it to the web browser on the fly as a PNG file. The problem that I am having is that I want to be able to change one of the colours within the file to transparent. I have tried searching Google for the answer, but I'm no...more >>

Regex parsing - numeric values with whitespace
Posted by David at 5/9/2006 9:37:22 AM
I have rows of 8 numerical values in a text file that I have to parse. Each value must occupy 10 spaces and can be either a decimal or an integer. // these are valid - each fit in a 10 character block 123.8 123.8 1234.567 12345 12345 1234.567 // these are not valid ...more >>

MySql Insert what am I doing wrong?
Posted by Ivan Sammut at 5/9/2006 9:25:27 AM
Hi, I am using a Mysql Database with c# and I am trying to insert a record in my table. My code is as follows. MySqlConnection mySqlConnection = new MySqlConnection("Network Address=localhost;Initial Catalog='test'; User Name='root';Password='tottenham'"); // MySqlCommand mySqlCommand =...more >>

How to ...
Posted by Jacek Jurkowski at 5/9/2006 9:10:30 AM
.... inform Win Forms Designer that some code shouldn't be executed in design time... ...more >>

question on focus
Posted by CobraStrikes NO[at]SPAM al.com at 5/9/2006 8:58:41 AM
Hi All, Is it possible to find which object (textbox,listview etc) has the focus without testing each and every object on the form. Thank You. ...more >>

<summary>
Posted by Arne Garvander at 5/9/2006 8:29:03 AM
How do I add a summary remark to a C# class? -- Arne Garvander (I program VB.Net for fun and C# to get paid.)...more >>

Marshal bool array to dll
Posted by gpg at 5/9/2006 8:19:02 AM
I am using a legacy DLL and need to marshal some structures for use in the DLL. For the most part, I have figured out my needs except for one small item. I have a structure that contain, among other items, an array of bools (not BOOL). The array is a fixed size and is contained in the struc...more >>

Overriding == and != when overriding Equals()?
Posted by Kenneth Baltrinic at 5/9/2006 7:39:33 AM
When one overrides the Equals() method of an object, one is supposed to override GetHashCode() as well and this makes good sense. But I have seen lots of people who do this and do not override the == and != opperators. Am I missing something or when would one want to have different implementati...more >>

restart my computer
Posted by Lamis at 5/9/2006 7:17:02 AM
Hi, is there any easy way to restart my computer... I have XP installed on my machin. I have tried this code but it is not working, I am getting an exception every time it runs. ManagementClass W32_OS = new ManagementClass("Win32_OperatingSystem"); ManagementBaseObject inParams, outP...more >>

Adding new classes without recompiling old code ?
Posted by friendhouston NO[at]SPAM gmail.com at 5/9/2006 7:09:13 AM
Hi, Have a requirement where new items may be added later to an existing list of items. These new items may have new features but will need to contain minimum basic features like description and price. These items should be added to the existing code without the code being needed to be recom...more >>

MSHTM: Howto access the elements within an <IFRAME>
Posted by cweeks at 5/9/2006 6:46:32 AM
I am using the Webbrowser control in VS 2005 C# Express to automate the navigation of pages on a partner's web site. The first page contains an <IFRAME> element: <iframe style='width:40; height:40'; align='center' marginwidth='0' marginheight='0' scrolling='no' frameborder='0' id='xyzlogin'...more >>

Which language are employers looking for - C# or VB.NET?
Posted by BLACKDOG157 NO[at]SPAM LYCOS.COM at 5/9/2006 6:45:15 AM
I am starting to study dot net languages, and I'm wondering - which language do employers look for - C# or VB.net? Are they both equally powerful languages? Thanks, BD ...more >>

How to get the path of current process ?
Posted by Sharon at 5/9/2006 6:10:02 AM
How do I find the full path where my current process is executed from? System.Environment.CurrentDirectory and System.IO.Directory.GetCurrentDirectory is not good enough because they may be changed any many circumstance and not reflect the original location the current process is started from...more >>

Send word document
Posted by neoret NO[at]SPAM gmail.com at 5/9/2006 5:23:00 AM
How do I send a word document as an attachement to a http call? Guess I have to parse it to bytes - does anyone know how this is done? Thanks for any help you can provide :) neoret ...more >>

Device Notification USB Port
Posted by Dave at 5/9/2006 5:16:07 AM
Hi all, I have a slight problem when it comes to finding a USB Port being attached to my PC. At present I can detect that the a USB Port has been attached using the : public struct BroadcastHeader //_DEV_BROADCAST_HDR { public int Size; //dbch_size public DeviceType ...more >>

How convert java color model into C#
Posted by Neeraj at 5/9/2006 3:31:11 AM
Hi, I am going to make a dicom viewer with help of java free source code. But i totally confused to how i convert Java ColorModal into Corresponding csharp. If any have idea please help me With Regards. Neeraj Kumar ...more >>

Is it a mapped network drive ?
Posted by Sharon at 5/9/2006 3:13:01 AM
Given a full path (C:\Dir1\Dir2\... or \\host\dir1\dir1 etc.), How can I tell if the root drive of the path is a local drive or mapped network drive? -------- Thanks Sharon...more >>

Uploading a text file to a server
Posted by dawson at 5/9/2006 2:16:51 AM
Hello, when running the code below, it returns the error message: "The requested URI is invalid for this FTP command.". I have confirmed the FTP URI is correct and working through a standalone FTP client as well as windows explorer, the domain\username and password are also valid auths. I...more >>

confused about generics and abstract classes
Posted by herpers NO[at]SPAM wiso.uni-koeln.de at 5/9/2006 2:05:07 AM
Hello, I probably don't see the obvious, but maybe you can help me out of this mess. The following is my problem: I created two classes NormDistribution and DiscDistribution. Both classes provide an implemation of the operator +. Now I want to write another generic class Plan<DType>, whi...more >>


DevelopmentNow Blog