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# > june 2005 > threads for wednesday june 22

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

Overload error
Posted by Ant at 6/22/2005 10:52:01 PM
Hello, I'm a total newbie to .NET & C# so... When I use Messagebox to show a string & test it, no problems. i then change the string to an integer, save, rebuild & test & it comes up with this error: The best overloaded method match for 'System.Windows.Forms.MessageBox.Show(string)' has so...more >>


Yield Keyword in VB.NET 2.0
Posted by Sahil Malik [MVP] at 6/22/2005 10:01:31 PM
What the heck - I can't find it. A bit shocked to see it missing though. So "Does VB.NET have the yield keyword, or any equivalent of it" ? -- - Sahil Malik [MVP] Upcoming ADO.NET 2.0 book - http://tinyurl.com/9bync --------------------------------------------------------------------------...more >>

Comparing strings
Posted by rossum at 6/22/2005 9:49:17 PM
I was comparing strings, as one does: stringA.CompareTo(stringB) == -1 Then I thought that this was not as easy to read as it could be, wouldn't it be clearer to write: stringA < stringB Of course that doesn't compile since the < operator is not defined between strings. Easy enou...more >>

How can I configure Solution Explorer?
Posted by steve bull at 6/22/2005 9:08:51 PM
When I double click on a source file in Solution Explorer it always brings up the design interface for a control. Is there somewhere that I can change it so that it brings up the code instead? Thanks, Steve...more >>

Custom Control Properties aren't persistent
Posted by Shacker at 6/22/2005 6:18:17 PM
Hi, I've written a custom control that has 6 labels and 3 properties. The properties are of type ENUM so they show up as a drop list when the control is dropped on a form. I choose a value for each property and the labels reflect that (works great during design time). The problem is that ...more >>

NonVisual Help Needed (I have such a headache)
Posted by LC at 6/22/2005 6:05:16 PM
I am learning C# .net and am working with Visual C# .net package. I am trying figure out how to create a nonvisual object that can contain functions/methods that would be called to enforce business rules. After reading oh so many posts I am still not sure. Do I create a new class by going...more >>

Re-entrancy, shortcuts in a TreeView
Posted by Michael A. Covington at 6/22/2005 5:36:46 PM
I'm extending TreeView to build a file/directory chooser like the one in NTBACKUP. I've implemented four-state checkboxes; no problem. And I know how to explore files and directories and populate the tree (including populating branches on demand, when the user first expands them, rather ...more >>

SqlCommand.ExecuteXmlReader() - How to Use?
Posted by Steve Harclerode at 6/22/2005 4:44:54 PM
I tried this on another newsgroup but no nibbles -- I'm hoping someone might be able to help on this csharp group -- I'm trying to use SqlCommand.ExecuteXmlReader() to write data to an XML file. Most of the code is below. The result I'm seeing is that the schema file is written and looks go...more >>



Create an outline area
Posted by citytroop NO[at]SPAM yahoo.com at 6/22/2005 3:41:30 PM
Hi I am creating a form for vieweing and editing faxes. I read the fax tiff file into the picturebox. And I have two problems: 1.I want to add a function for the users to be able to select an area in the picture box and clear it. I am using the Graphics.DrawRectangle method but the rectangle...more >>

ad-hoc c# compiler - does it exist?
Posted by John Grandy at 6/22/2005 3:37:10 PM
Does anyone know about this ad-hoc c# compiler? I've heard that there's a c# compiler that's works as a single file you just drop into a directory and use to compile stand-alone .cs files in a very simple manner. It might even automatically recompile whenever the .cs file is saved ... U...more >>

Serialization of an object containing an ArrayList
Posted by Bry at 6/22/2005 2:03:12 PM
I have an object which contains an object of type ServiceController[]. When I attempt to serialize this object using a binary formatter, I receive the runtime error message, "...is not marked as serializable". Code snippet: [serializable] class MyObject { // One of the properties p...more >>

How memory stacks up.
Posted by Frank Rizzo at 6/22/2005 1:45:21 PM
Hello, doing some profiling work and trying to resolve the memory usage balooning through the roof. Just want to make sure that my reasoning is correct. My question is as follows: Let's say I have 1000 ArrayLists and each of them has quite a bit of data in them. Does .NET framework load 1...more >>

buttons disappeared
Posted by melanieab at 6/22/2005 12:50:02 PM
Hi, I'm not sure what happened here, but I had a whole set of tabpages with home-made buttons on them. A shortened version of the class I wrote them in is here: using System; using System.Windows.Forms; using System.Drawing; namespace ToleranceUnits { public class Button3x : CheckBo...more >>

Unicode Question
Posted by nebiyou1 NO[at]SPAM gmail.com at 6/22/2005 12:38:06 PM
When I execute the following program, I get garbage for the ethiopic character whereas I get the right ones for the arabic characters. I have the ethiopic fonts installed. Any ideas why I am getting garbage instead of the right charcter for the ethiopic character? Do I need to set something in v...more >>

Difference of Enum and Enum.ToString()
Posted by Leif Eirik Olsen at 6/22/2005 12:32:11 PM
Hi, Can anyone please tell me if there is a difference between the two options described below: public enum PingerID {All, A=240, B, C, D, E, F, G, H, J, K, L, M, N, P, R, T, Unknown}; for (PingerID Pid = PingerID.All; Pid <= PingerID.T; Pid++) if (PingerID.IsDefined(typeof(PingerID), (i...more >>

Untrappable System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback exception
Posted by Ram P. Dash at 6/22/2005 12:10:01 PM
Hi, I've a c# windows service constantly communicating with an ASP.NET web service. After running for sometime, I am getting the following exception at the windows service (client): Object reference not set to an instance of an object. [Stack Trace: at System.Net.HttpWebRequest.ClearRe...more >>

Send binary data to the standardInput of a process
Posted by O_Spring at 6/22/2005 11:57:06 AM
I am writing a program in c#. I would like to read a binary file to the standard input of a process (it is flac.exe to encode/decode some files). I have tried to use the following code : StandardInputWriter = convertProcess.StandardInput; [...] byteRead = SourceFileStream.Read(buff,0,BUF...more >>

Service and system shutdown
Posted by Andy at 6/22/2005 11:55:40 AM
hi all, I've created a windows server that will watch to make sure another process stays running. It looks for the Process and attaches to the Exited event, which works fine. If the program is closed, my service correctly restarts it. The problem is that its working a bit too well, and i...more >>

C# Sql Query Designer
Posted by Joshua Belden at 6/22/2005 11:51:06 AM
Okay, how I get myself into these situations, I don't know, but I have to design a component to plug into a C# Windows Forms application that allows the user to design a sql query. I'm thinking of something like the view designer in Enterprise Manager. Does anyone have any idea if there are...more >>

How to debug(step thru) a main appl with 33 projects in it?
Posted by Alpha at 6/22/2005 11:33:07 AM
Hi, I'm fixing a bug in an application and need to step thru the appl to find where it's occuring. The main project includs 33 other projects each having a .resx file in it. When I step through it would give me message that it can't show me codes because only assembly codes are available. ...more >>

Factory pattern
Posted by Andy at 6/22/2005 10:57:18 AM
Hi all, I'm developing n-tier applications and I'd like some advice. I have my data layer, business layer, and application layers. The data layer uses a method similar to the one described here: http://www.codeproject.com/cs/database/dal1.asp. Business objects encapsulate the data acces...more >>

Is this the way MDI is supposed to work?
Posted by **Developer** at 6/22/2005 10:55:52 AM
I can live with this but I wonder I I'm somehow causing it or can override it. I'd appreciate hearing that this is expect behavior or otherwise. Thanks I have two forms - Form1 and Form2 On each there is a RichTextBox - Box1 and Box2 If Form1's title box is highlighted and I'm typing ...more >>

Writing to file
Posted by Philip Germanos at 6/22/2005 10:31:04 AM
Hello, I have a text file that contains 5 lines, I want to write to it: removing the first line and replacing it with something else, while keeping the other lines. Can someone tell me how it could be done? Its a silly question but I am a new developer in C#. Thank you....more >>

Serialport Class: SerialDataReceivedEventHandler
Posted by Nathan Ie at 6/22/2005 10:26:04 AM
Hello all! I was wondering if any of you could shed some light on this problem I cant seem to figure out... I try to add an event handler to my SerialPort variable by doing: mySerialPort.DataReceived += new SerialDataReceivedEventHandler(newDataReceived); where "newDataReceived" is ...more >>

Converting MSSQL FTS parsing function from VBScript to C#
Posted by kenfine NO[at]SPAM u.washington.edu at 6/22/2005 10:18:37 AM
Hi all, I'm here to humbly request some "gimme" help from the group. I discovered the infinite wonders of VS.NET 2005 and ASP.NET 2.0 at Tech Ed a couple of weeks ago, and since returning to work I haven't looked back. Unfortunately I still have some critical functions that I originally cre...more >>

Int to Null ? Is possible ?
Posted by Paperback Writer at 6/22/2005 9:58:44 AM
Hi All, How are you ? I'm trying to insert null values in my database, but these datas are datatype Int in my C# and it's converting my null values to 0 (zero)! How could i threat that ? -- Please, check my theSpoke: http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx ...more >>

PropertyGrid and ArrayList
Posted by Marius at 6/22/2005 9:40:12 AM
I have a class: public class ZType : ICustomTypeDescriptor { private ArrayList el = new ArrayList(); [Editor(typeof(MyCustomEditorTypes), typeof(UITypeEditor)), Browsable(true), Category("Data")] public ArrayList Elements { get { return this.el; } se...more >>

ASP.NET & Printing Web Pages
Posted by mjcast at 6/22/2005 9:35:00 AM
Hi I am working on a solution for a web page that can print itself using the browser's printing capabilitiy, but I cannot use javascript on the project. How can I print the web page? Thanks in advance for any help....more >>

Process MainWindowHandle
Posted by Moty Michaely at 6/22/2005 9:19:49 AM
Hello all, I am enumerating vb6 process from c# application by name. I need to send message to all processes that has the specified name but for this purpose I need the handle of the main window for each process returned. I once read that vb6 app mainWindowHandle is the handle of the hidd...more >>

Embeding an office document in a c# app
Posted by dan.neely NO[at]SPAM gmail.com at 6/22/2005 8:20:26 AM
I need to embed excel functionality into my app, but can't find a complete solution. The article below shows how to embed it as activeX in a browser control, but the control doesn't support bringing excels menus into the program. Is there annother approach that would allow more complete functi...more >>

Collections
Posted by karthick at 6/22/2005 8:14:51 AM
Hi, As I am trying to display values from database in labels, literals etc. which is the best way to do it, using the object oriented methodology ?!. Basically, I want to creat a collection of values from the database, store in class vars and access it through an object. Any articles, co...more >>

extracting list of websites from IIS manager
Posted by Abhi at 6/22/2005 8:10:11 AM
Hi- I'm looking for C# code sample that will extract the list of websites from the IIS manager. anyone? Thanks! ...more >>

transparent textboxes - quick question
Posted by melanieab at 6/22/2005 7:00:06 AM
Hi, I found this online: "If the SupportsTransparentBackColor bit is set to true, and the BackColor is set to a color whose alpha component is less than 255, OnPaintBackground will simulate transparency by asking its parent control to paint the background." What I've tried to do is this: ...more >>

Events With Feedback
Posted by pagates at 6/22/2005 7:00:05 AM
Hello All, Does anybody have an example to raise an event that may or may not give feedback to the caller? I am thinking about something roughly like the Cancel property of an CancelEventArgs or the Handled property on the KeyDown events. What I have is a user control that I want to rai...more >>

RE: Can i access from c# to java via JNI ?
Posted by Dave at 6/22/2005 6:45:09 AM
You have to use something like JNBridgePro....more >>

Can i access from c# to java via JNI ?
Posted by yaron at 6/22/2005 6:10:11 AM

How to build function GetNodeByText for TreeView?
Posted by Ivan Abramov at 6/22/2005 5:56:04 AM
I have such one written in VB6. Public Function GetNodeByText(colNodes As Nodes, sText As String) As Node Dim nodEach As Node, nodResult As Node For Each nodEach In colNodes If nodEach.Text = sText Then Set GetNodeByText = nodEach Exit Fun...more >>

Regex - Is this the best expression to match with...
Posted by Dave at 6/22/2005 4:31:01 AM
This works but I was wondering if there is a better way to write this expression? Input text: multi-word | optional space = optional space | single word | ; optional carriage return --------------------------------- sometext=something; moretext = something; other text = something; E...more >>

Terminating active threads in Multi-threaded application question
Posted by Naveen Mukkelli at 6/22/2005 4:29:05 AM
Hi, I'm working on a multi-threaded application. I'm using ThreadPools. One of the requirements of the application is, if certain exception occurs all the counters have to be reset. I have noticed that some threads, even after resetting the counters, have the old values. Is ther...more >>

How do I repeat html output in aspnet and c#?
Posted by Salvador at 6/22/2005 4:28:02 AM
Hi, Maybe is a simple question but I found difficult to find the answer. Context: I am creating a site where designers ONLY touch the ASPX page and I.S. touch the code behind. Task: I have a simple page that list a number of offers based on info from the system (no dabatase, no bound ...more >>

(int) or convert.ToInt32 ?
Posted by Jarod at 6/22/2005 4:11:02 AM
Hey I have following "problem". int id = (int)SQlHelper.ExecuteScala(...) - it returns object ( which is int ) I get invalid cast. Convert.ToInt32(...) works ok. Why ? Jarod...more >>

this == null ?
Posted by Olivier Nizet at 6/22/2005 3:21:03 AM
Hi, while investigating the Framework dlls via Reflector, I found this code : System.Drawing.Graphics : public void DrawImage(Image image, int x, int y) { if (this == null) throw new ArgumentNullException("this"); ... } I was thinking of a mistake because from a...more >>

Get File From Folder
Posted by simon_add NO[at]SPAM op.pl at 6/22/2005 2:45:55 AM
Hello. I have to know about file in folder with *.jpg extend. I use this fragment of code. DirectoryInfo directory; ArrayList file = new ArrayList(); directory = new DirectoryInfo(folderPAth); foreach( FileInfo dir in directory.GetFiles("*.jpg") ) { file.Add(dir.FullName); } What...more >>

Watch Window colors
Posted by Andrew Ducker at 6/22/2005 2:26:38 AM
What does it mean when the watch window shows a value in red? I ransacked the help file but couldn't find any mention of this. Cheers, Andy D ...more >>

Combo Box Question
Posted by orekinbck NO[at]SPAM yahoo.com.au at 6/22/2005 1:27:31 AM
Hi There I have a combo box with DropDownStyle = DropDownList The user wants a different string to appear in the display rectangle than from the strings in the list. So for example, the drop down list items might say One Two Three Then when I select 'One' and move focus away from ...more >>

Event loop to not exit my program
Posted by julien at 6/22/2005 12:34:31 AM
Hello, I need to add a waiting loop to my program so I don't exit right a way. This loop has to be non-blocking (the program has to handle other events), and shouldn't take much resources (not a busy waiting). It is a command line program, so I don't get the event loop of any graphical lib...more >>

Sockets (Urgent)
Posted by Yuri Ch at 6/22/2005 12:15:26 AM
Hi all, I'm quite new in C# and have no expirience in sockets. I have no idea how to implement the following app, but for expirienced developer, I suppose it should be very trivial... I have to write any server component very urgent... The component has to synchronize between 3 clients for p...more >>

Inheritance question
Posted by Michael A. Covington at 6/22/2005 12:00:00 AM
Suppose class X has some public properties, and class Y inherits from X. Is there a way that some of the public properties of X can be private (hidden) in Y (but still usable by the methods inherited from X that use them)? ...more >>

Current Exception
Posted by Chad Z. Hower aka Kudzu at 6/22/2005 12:00:00 AM
Its a bit tough to explain why I need this, so I wont. Consider it academic for now. I would like to detect if an exception is currently being thrown, but I cannot use a try statement. This is not what I want to do, but this will demonstrate what I want to do: try throw exception finally...more >>

Why can't switch be used for objects
Posted by cody at 6/22/2005 12:00:00 AM
Why can't switch used for objects, at least for static readonly fields it wold be nice. The Jit could certainly optimize this case because the addresses of static readonly variables are known at jit time. The thing is that is often used my own enum classes because I usually want to assign ...more >>

Nullable datatypes
Posted by Mark Rae at 6/22/2005 12:00:00 AM
Hi, I posted a couple of days ago about the possibility of "simulating" in ..NET1.1 the nullable datatypes available in .NET2.0 - I'm nearly there, but require a bit more guidance. Basically, I have a class file which contains the various class definitions, as follows: using System; ...more >>

DataTable
Posted by Aleksey at 6/22/2005 12:00:00 AM
Hi! I need save data from DataTable to XML file. Is there any standard method do that? Thanks a lot ...more >>

How to Call dos command like "ping 10.0.0.1" and trace the respond?
Posted by James Pang at 6/22/2005 12:00:00 AM
-- Tech Servant James Pang. ...more >>

FileSystemEventArgs
Posted by Peter Kirk at 6/22/2005 12:00:00 AM
I am still "playing" with FileSystemWatcher, and have a question regarding FileSystemEventArgs. For example, the following method is called when a file is created: private void OnCreated(object source, FileSystemEventArgs e) { Console.WriteLine("OnCreated: FullPath=" + e.FullPath + "; Nam...more >>

String.Split(), Regex.Split() - empty String
Posted by Rico at 6/22/2005 12:00:00 AM
If there are consecutive occurrences of characters from the given delimiter, String.Split() and Regex.Split() produce an empty string as the token that's between such consecutive occurrences. It sounds like making sense, but has anyone ever found this useful? Can this 'feature' be disabled? A...more >>

XML encode method?
Posted by Sosh at 6/22/2005 12:00:00 AM
Hi, I was wondering if there is a method in the XML classes that allows you to encode a string so it is safe to stick in an XML file? I would have thought so, but can't find it. Please tell me I don't have to do a replace for each of the dissallowed characters!! Thanks...more >>

Update requires a valid InsertCommand when passed DataRow collection
Posted by Jon S via DotNetMonster.com at 6/22/2005 12:00:00 AM
Hi all, I'm having a problem updating a simple change I've made to a Access 2000 table through databinding. The error I get is : An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll Additional information: Update requires a valid InsertCom...more >>

Problem with System.Windows.Forms.Design.FileNameEditor
Posted by Polo at 6/22/2005 12:00:00 AM
Hi, I have a class CustomFileNameEditor that inherits from FileNameEditor I override the method "InitializeDialog" to customize the filter property When I run the application this method is called only one time. The problem is that the filter property can be change for each instance of the ...more >>

I want to make common connection string for database
Posted by Alex Smith at 6/22/2005 12:00:00 AM
Hi Friends I want to make common connection string for database. I can not use Web config file, so please give idea excluding web.config file. Thanks. Alex ...more >>

Naming convention for keys in resource files
Posted by Joey Lee at 6/22/2005 12:00:00 AM
Hi, Microsoft provided some naming conventions for namespace, classes, properties and etc. However I am looking for naming convention for keys in resource files for multiple languages. Any ideas? Thanks Joey ...more >>

how to make use of the xml that has been included in the project?
Posted by ywchan at 6/22/2005 12:00:00 AM
I have add an xml file in my project. I would like to know how to create an xmldocument with it? thanks ...more >>

TabControl's background color
Posted by TroLoo at 6/22/2005 12:00:00 AM
Hi, I'm fighting with it for a while... How can I change this control's background color (and only background color)? It should be easy and straightforward but I guess it is not... To be precised, I don't want to change TabPage's background :-/ What I mean is the background before any Ta...more >>


DevelopmentNow Blog