Groups | Blog | Home


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# > march 2006 > threads for tuesday march 21

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

Form Focus Problem
Posted by shajeel at 3/21/2006 10:46:32 PM
Hi, i m having a problem getting the focus on the form, i m starting two form one after another, here is the sequence. first is splash second is dialog taking values main() { Start new thread and start splash in it with Application.Run() or splash.ShowDialog After some work i close...more >>

are System.Data.SqlClient.SqlConnection thread safe? can many threads share a System.Data.SqlClient.SqlConnection instance without any synchronization
Posted by Daniel at 3/21/2006 9:59:02 PM
are System.Data.SqlClient.SqlConnection thread safe? can many threads share a System.Data.SqlClient.SqlConnection instance without any synchronization? ...more >>

C# code to open a windows directory
Posted by Shilpa at 3/21/2006 9:47:15 PM
Hi All, I need the C# code to open a windows directory. Regards, Shilpa ...more >>

Dynamic Types with Reflection.Emit, how to ?
Posted by Luis Arvayo at 3/21/2006 9:39:19 PM
Hi, In c#, I need to dynamically create types at runtime that will consist of the following: - inherits from a given interface - will have a constructor with an int argument - Will have an event handler (derived from the interface) - Will have a method that will return the value o...more >>

The mechanics of vs2005 projects
Posted by Frank Rizzo at 3/21/2006 9:18:45 PM
Hello, I work with a vs2005 solution that has about 10 pretty heavy duty projects. All projects have dependencies among themselves via project references (as opposed to DLL references). As you can imagine vs2005 takes its sweet time when I press the run/debug button. So as an experiment, I...more >>

Identify a file type and open a file
Posted by Shilpa at 3/21/2006 9:11:10 PM
Hi All, I want to write C# code to identify a file type and open the file in the associated editor. For example, text files should be identified and opened in notepad, html should be opened in internet explorer/netscape/mozilla. At design time, I do not know if internet explorer/netscape is ...more >>

microsoft.public.dotnet.languages.csharp
Posted by Eugene Vtial at 3/21/2006 9:06:16 PM
I am using C# to connect to a MySQL server and I need to be able to save a fully qualified path into a table however MySQL strips out the path separator character "\". Is there a way in C# to replace all occurrences of "\" with "\\" in a string? thanks......more >>

Question regarding partial classes
Posted by Steve Le Monnier at 3/21/2006 8:20:41 PM
Partial Classes allow you to split code between two or more physical files, and during compilation they are re-joined, or so the book says. If that's the case why is it that I must have namespace using directives in both classes otherwise I get build errors? Cheers Steve Le Monnier ...more >>



StreamReader::ReadLine() blocks
Posted by Kin at 3/21/2006 7:17:28 PM
I am trying to read the output of an external application using redirected stdout and StreamReader::ReadLine(). The problem is that ReadLine() blocks and I am either reading nothing or just part of the output. I start a new process from my app to run the external app. StartInfo.RedirectSt...more >>

Check for existence of an object?
Posted by CK at 3/21/2006 6:44:42 PM
How can I check for the exisitence of an object in C#/Asp.net? I have a routine that initailizes form values based on a loaded up object, however if the object hasn't been created I get an Object reference not set to an instance of an object. Is there a function I can use to see if the object...more >>

Standard Registry locations affected by Virus's ,Spyware and Adware
Posted by vighnesh at 3/21/2006 6:07:45 PM
Hai All Can anybody please tell me what are the standard registry locations that are affected by Virus's , Spyware and Adware Programs. Thanks in advance Regards Vighneswar ...more >>

from DataReader to double[] array (asp.net20 c#)
Posted by Web learner at 3/21/2006 6:03:39 PM
At line unitsInStock.Add((double)dr.GetValue(1)); I get same error: Specified cast is not valid If you comment out above code line and also Response.Write(unitsInStock[0]); then the code works fine. That means it works for productName array. My purpose is to populate an array from SqlDataRe...more >>

Color fading
Posted by Joe at 3/21/2006 5:22:50 PM
I want to fade a color to another color in a user control. Actually the color is the BackColor of the User control. What's the easiest way to do this? Thanks, Joe ...more >>

calling method from one class without declaring the class again??
Posted by c#2006user at 3/21/2006 5:19:26 PM
hi if i want to do this in c#, where HomePage_MainListSelected() is in another class than this code , how do i do it? becaise HomePage_MainListSelected does not exist in the current context according to the comiler. the class HomePage_MainListSelected() is in, inherits from the class the e...more >>

A question about call dll in c#
Posted by Beareye at 3/21/2006 5:08:00 PM
there is a function in UA2011.dll : void stdcall read_201(HANDLE h201, short *addat, unsigned long leng) Now I write this code in c# like this: Class Uac: [DllImport ("UA200.DLL") ] public static extern void read_201(int h201, IntPtr addat,long leng); I use read_201 to collec...more >>

C# String and Escape sequence during Concatentation???
Posted by dm1608 at 3/21/2006 4:30:05 PM
I'm looping thru a reader object for SQL Server. Two of the files I'm returning are the "UNC" name of a server and a "File Path". Data looks something like: UNC = \\10.246.16.18\MYSHARE File Path = "\MyDir\MySub\myfile.txt" I'm trying to append these two fields to a string and I'm only ...more >>

Can't reference classes within a class
Posted by Ray Stevens at 3/21/2006 4:24:58 PM
I have a dataclass that was created by a code generator. A snippit of its output is as follows: namespace SoftwareAG.EntireX.NETWrapper.Generated.laf801n1.Groups { public class Laf801n1 { public class Laa001a2 { public string environment ; public...more >>

Unicode character conversation
Posted by Antimon at 3/21/2006 3:44:31 PM
Hi, I need to convert a unicode string to ASCII. I can simply use getbytes method to do that but i would use some characters since Unicode is 16bit. But i thought there might be some way to convert characters like "=FC" to "u" or, "=E5" to "a". Or a chance i can find a conversation table? ...more >>

Out-of-process COM object in C#
Posted by Simon Hart at 3/21/2006 3:28:37 PM
Hi, Does anyone have an example of doing this? Regards Simon. ...more >>

Overriding generic virtual method
Posted by Harold Howe at 3/21/2006 3:04:50 PM
Is it possible to override a specific instance of a virtual, generic method? IE: using System; class Base { public virtual void Test<U>(U u) { Console.WriteLine("Base.Test {0}, u); } } class Derived : Base { public override Test(string u) { Co...more >>

Passing Data From CustomControls C#
Posted by MikeY at 3/21/2006 2:49:26 PM
Hi Everyone, I have a custom control on my application and I am trying to pass the data items from the selected custom buttons back to a ListView. I'm sitting here scratching my head thinking I should know this. The ListViewnamed ListView1 resides on Host_Horizontal_Btn "Form1".cs and my ...more >>

Regex: Finding strings in a source file
Posted by Bob at 3/21/2006 1:33:22 PM
I need to create a Regex to extract all strings (including quotations) from a C# or C++ source file. After being unsuccessful myself, I found this sample on the internet: @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'" I am inputting the entire source file string and using it with RegexOptio...more >>

Getting the century only from a year
Posted by Doug at 3/21/2006 1:23:15 PM
Is there a format that can be used in DateTime.ToString() that will allow you to get only the century of a given year. "yy" of course doesn't work, that returns the year itself, not the century. ...more >>

Read a RTF File
Posted by Thomas Heiz at 3/21/2006 1:04:10 PM
Which method is the best to read a RTF File in C#? StreamReader sr = new StreamReader(filename, System.Text.Encoding.GetEncoding(1252)); while((rtfContent = sr.ReadLine()) != null) { builder.Append(rtfContent); } sr.Close(); Is it better to read a RTF file with sr.ReadLine() or sr.ReadToEnd...more >>

RTF generator
Posted by Tomaz Koritnik at 3/21/2006 12:47:12 PM
Hi Anyone knows if there is any free or comercial RTF generator/writer for C#? I want to generate RTF files with text, tables and probably other things too. regards Tomaz ...more >>

enumeration question
Posted by jamie at 3/21/2006 12:45:51 PM
I almost never use enumerations. I've been given a class by using XSD /c on a schema file. This will be used to generate an XML file It gives me back lots of classes Anyways one of those classes is public class Transmit{ [System.Xml.Serialization.XmlElementAttribute(DataType="integer"...more >>

Default Maxlength - CLR 2.0
Posted by drchips NO[at]SPAM nospam.nospam at 3/21/2006 12:26:54 PM
Since I upgraded to VS2005 - when I drag a stored procedure onto a dataset now - the datatable is setting maxlengths for some of my fields. Is there a way I can default the designer not to set the maxlengths. (I don't want to go through each column and set it to -1 by hand.) Same thing for the...more >>

Calling an event from an inner class
Posted by amaca at 3/21/2006 12:24:41 PM
In this slightly contrived (though small, complete and perfectly formed) example: public class Inner { public event EventHandler InnerHandler; public void DoSomething() { if ( InnerHandler != null ) InnerHandler( this, EventArg...more >>

Moral development question issue...
Posted by VMI at 3/21/2006 12:22:52 PM
I didn't know where else to post it, so I posted it here. Since it's more technical than anything, I assume that you guys have an answer :-) I've been trying to find an answer for this question for some time, but I haven't been able to. I have a client with a small business that wants me to ...more >>

Get Type Of Class - Create Instance?
Posted by Mythran at 3/21/2006 11:38:25 AM
System.Drawing.SystemColors is a class with all static properties. Here is what my short-ranged goal is... I want to enumerate all of the SystemColors properties and print the name (using reflection), and I am able to do this: PropertyInfo[] props = typeof(SystemColors).GetProperties(); ...more >>

Determining if a file string points at a drive, a path, or a file, or an onion.
Posted by theinvisibleGhost at 3/21/2006 11:09:22 AM
Subject says it all really. I'm being passed a string, and I'm wondering if theres an easy way to determine what exactly the string points at? Cheers Chris. ...more >>

getting a specific field from a dataset and displaying it in a label.
Posted by shelleybobelly NO[at]SPAM yahoo.com at 3/21/2006 11:04:52 AM
Hi, I am trying to use the ItemCommand in a datagrid (web form) to display *fields* from the specific row. Each row in the dataset has a primary key. The dataset single table is filled from a data adapter and SOME of the fields are displayed in a datagrid. Everything groovy, no problem. Now...more >>

Application.Run generating FileNotFound exception
Posted by TimThornton at 3/21/2006 10:42:50 AM
Hi, I have an applicationthat calls Application.Run from main, and this generates a FileNotFoundException. The solution has the main program and a number of DLLs, and it is saying that it cannot find one of the DLLs or its dependencies. Yet the DLL is present in the application folder, and it...more >>

Subclassing question
Posted by Michael Rodriguez at 3/21/2006 10:32:32 AM
How can you subclass a control and override just a sub-property like Font.Size? I was trying to do something like this: namespace Compeat.Common.Controls { public class MyTextBox : TextBox { public MyTextBox() { this.Font.Size = 12; } [DefaultValue(12)] ...more >>

Regex Help
Posted by Bryan Young at 3/21/2006 9:44:45 AM
I want to generate a usable filename (no path, drive letter, or extension) from strings from various sources (dates, database fields, user entry, etc). I'm trying to use the following line and regex to replace any invalid characters with an empty string. However, it doesn't work. I've tested th...more >>

Arrays of Multidimensional Arrays?
Posted by barmy_mad NO[at]SPAM yahoo.co.uk at 3/21/2006 9:31:00 AM
Hi I new to C# and trying to store/extract a collection of multidimensional arrays. For example; string[,] a_DATA = new string[10,3] object[] o_CON = new object[10] for(int i=0;i<10;i++){ for(int j=0;j<3;j++){ a_DATA[i,,j] = i + "x" + j } o_CON[i] =a_DATA } H...more >>

N-tier single project or multiple projects?
Posted by kamere at 3/21/2006 7:14:57 AM
For your N-tier solutions. Have you architected your UI, Business, and DAL layers into one single project or have you separated them out into separate projects? What would be the benefits of having all 3 layers in one project vs breaking them out to there own separate projects? ...more >>

Still not a single word for my problems.. please see act problem
Posted by garyusenet NO[at]SPAM myway.com at 3/21/2006 6:15:12 AM
i posted today my day has been totally fruitless. there must be someone out there that knows enough to figure this out? ...more >>

TcpClient / NetworkStream not failing on write?
Posted by david.topham NO[at]SPAM ukgateway.net at 3/21/2006 5:58:21 AM
Hi The code below demostrates an issue I'm having with with NetworkStream: using System; using System.Net.Sockets; namespace TCPCTest { class Class1 { static void Main(string[] args) { TcpClient tcpc = new TcpClient(); tcpc.Connect("localhost", 15015); byte[] bytea...more >>

ACT some progress but no one has replied so far - help please.
Posted by garyusenet NO[at]SPAM myway.com at 3/21/2006 4:39:59 AM
I posted earlier but no replies. I have made some progress and have managed to figure out (i think) syntax for connecting to the act database from c# only problem is it doesn't connect. When i ask for the error code it's -87 which is listed in the SDK as not being able to open the database. h...more >>

Manual Reset Event
Posted by juli jul at 3/21/2006 3:38:14 AM
Hello, How can I know that the Manual Reset Event object done WaitOne(). I have a condition and I want to do Set() to Manual Reset Event in it but I have to know that there WaitOne() was done on it before. How can I know that? Thank you! *** Sent via Developersdex http://www.developersde...more >>

Getting the InvocationList for an event in a different class
Posted by Andrew Ducker at 3/21/2006 2:37:17 AM
I have a class with a DataTable built into it. Various places subscribe to the DataTable.RowChanging event. I want to grab a list of all the subscribers. Normally I'd use GetInvocationList, but that only seems to work on events that are defined in the same class. Events declared inside a d...more >>

Optimize PaintEvent on WinForms?
Posted by Kenneth Siewers Møller at 3/21/2006 2:05:28 AM
Hi there I have a rather annoying problem. In .NET 1.1 I could have 20 controls (labels, textboxes etc) without any problem and the painting went satisfying. Now in .NET 2.0 whenever I have more that about 5-10 controls on one form, the painting is extremely slow. I use a lot of nesting wit...more >>

How to change public properties in base class as private in derived class.
Posted by santel at 3/21/2006 1:18:50 AM
Hi all, I have these classes public class Base { private string str; private string str1; public string MyStr; { get { return str; } } public string MySecondStr { get { return str1; } } } public class Derived: Base { } What I need is whil...more >>

RichEditBox as an immediate window
Posted by Udi at 3/21/2006 12:13:33 AM
Hi, How do I make sure that any character that is typed into my RichEditBox will be appanded to the Text? (I'm using the RichEdit as a console window. I'd like to allow the user selecting any part of the Text he likes, but when typing new chars, always add them on a new last line (-at the end...more >>

method allias
Posted by Steph at 3/21/2006 12:00:00 AM
hy, i m looking for define a method alias in c# RTrim and LTrim doesnt exists... and we need to use TrimStart TrimEnd so.... how define a alias public string RTrim = public string TrimStart ? ...more >>

Trouble with ArrayList
Posted by Alberto at 3/21/2006 12:00:00 AM
When I was working with vs 2003 I was used to do thinks like this: ArrayList a = new ArrayList(); Doc d = new Doc(); d.field = "value"; a.Add(d); .... ((Doc)a[0]).field = "other value"; And it works very well. But now, in vs2005 it doesn't work and I don't know why. How can I make ...more >>

Interlocked vs volatile
Posted by Ryan Liu at 3/21/2006 12:00:00 AM
Hi, Can some one tell the criteria I can used to decide use of Interlocked.Increment() vs volatile , which is better? Thanks a lot! Ryan ...more >>

Cannot convert type 'System.Windows.Forms.HtmlDocument' to 'mshtml.HTMLDocument'
Posted by Paul Hemans at 3/21/2006 12:00:00 AM
I am very new at .Net. I have a small project where I need to manipulate the contents of a web page. I have a form with a web browser control (webBrowser1) on it. Within the webBrowser1_DocumentCompleted method I have the following code. mshtml.HTMLDocument oDoc = new HTMLDocumentClass(); ...more >>

how does the rownumber change after rowscopy
Posted by Taoge at 3/21/2006 12:00:00 AM
hi, I'd like to know how does the rownumber - getrow() if copy rows to the datawindows itself, what's there new row numbers. for example, if i have dw have 10 rows, if copy rows 3-5 and insert the 3 rows before row 9, what are the new copied row number? ...more >>

Get print window information
Posted by Taoge at 3/21/2006 12:00:00 AM
Hi, all When we click or select Print in IE, a print windows pop-up, is there anyway to capture this message and get the information of the print window (i.e. pages ,paper,defualt printer,...) and i can control the printing job continue or cancel it. thanks a lot ...more >>

converting char[] to string
Posted by claire at 3/21/2006 12:00:00 AM
I have a char[] that i convert to a string as follows m_tHeader.m_sshortname is defined as char[8]; string result = new string(m_tHeader.m_sshortname); The problem is that any '\0' chars in the array remain in the string and it's not terminated properly. Is there a nice way to trim these...more >>

MemberShip provider for Windows Form Application
Posted by kids_pro at 3/21/2006 12:00:00 AM
Dear all, I have search for this topic and found article on how to use ASP.NET MemberShip provider instead. Is it the way .net 2.0 expected us to do? If it really safe to develop win app by using some web library? Looking forward your comments. kids...more >>

Dynamic instance creation
Posted by Enrico Foschi at 3/21/2006 12:00:00 AM
GoodMorning, I'm an italian developer, so, first of all, excuse me for my poor and incorrect english. I am writing here hoping to find some advice for a procedure that a like to create: I would like to create a software where all services available (database view, database backup, etc...) ar...more >>


DevelopmentNow Blog