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 2005 > threads for monday 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

Helper methods, static vs. instance
Posted by Rasika at 5/9/2005 11:30:01 PM
Memory usage wise is it a good idea to specify methods in utility/helper classes as instance methods rather than static methods? Rasika....more >>


strong naming with build process
Posted by alex at 5/9/2005 10:52:38 PM
I've got a control I need to release as both a regular and strong named version. The problem I'm running into is that it seems without creating a new project file and assemblyinfo.cs file I don't see a way I can compile both as a build one after the other. Are there any command line arguments ...more >>

Find in Files
Posted by VJ at 5/9/2005 9:38:16 PM
I am looking to do a Find in Files function , I want to be able to search for Txt String in a specific folder, the folder could contain any type of file. I would be able to want to search any file other than picture or image files.. that would be of great help. Thanks VJ ...more >>

Unit testing with multi-project solution question.
Posted by Naveen Mukkelli at 5/9/2005 8:16:02 PM
Hi, Currently, I've got all my unit tests in a separate class in the same project. Instead of this, I'm planning to move all my tests in a separate project in a single solution. For example let "TargetProject" is the main project in a solution. My plan is to have another proj...more >>

Getting strange MDAC Message
Posted by Robert W. at 5/9/2005 5:34:03 PM
I'm trying to add simple database functionality with a Windows Forms app I'm building. FYI my development machine is running Windows XP Pro, with all the service packs installed. First I tried using the standard OLEDB connection string (ie. "Provider=Microsoft.Jet.OLEDB.4.0...") but got th...more >>

How to initialize array dynamically?
Posted by Brett at 5/9/2005 4:05:03 PM
I need an array but don't know how many items will go into it upon declaration. int ArrayIndex = 0; string[] linkArray = new string[]{}; for (int i = 0; i < Links.Count; i++) { linkArray[ArrayIndex] = u.AbsoluteUri; ArrayIndex++; } The first time through the loop...more >>

System.Environment.MachineName
Posted by cloudx at 5/9/2005 2:55:07 PM
Hi there, In VB we call API to get a computer name, is MachineName the replacement in C#? Thanks!...more >>

How to replace escaped strings?
Posted by Brett at 5/9/2005 2:24:07 PM
I've been trying different methods for replacing escaped strings. None work. I even have a custom Replace() method but still can't get what I need. Some of the characters I need to replace are: \r\n with nothing \" with only single quote. myString = myString.Replace(@"\"", @"""); Repl...more >>



How to declare external lib in C#?
Posted by cloudx at 5/9/2005 2:16:01 PM
Hi there, I would like to retrieve the computer name in C#, here is the piece of code in VB: Private Declare Function GetComputerNameAPI Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long How do I translate to C#? thanks! ...more >>

import dll c++ function
Posted by centrino at 5/9/2005 2:01:01 PM
Any body knows how to convert this DLL function to C# ? DWORD WINAPI importfunction(LPSTR lpBuffer, LPDWORD nSize); ...more >>

Help creating an enumeration
Posted by Randel Bjorkquist at 5/9/2005 1:40:07 PM
Hers's my question. I want the ability to set a property of an object I've created, from outside of the class code (ie... inside of "Main" or an application event), with an enum. Something like this: CODE IN "Main": TItem MyItem = new TItem(); MyItem.Discount = TItem.eDisount.DISC...more >>

books
Posted by Brett at 5/9/2005 1:30:58 PM
Object-Oriented Thought Process, The (2nd Edition) (Developer's Library) http://www.amazon.com/exec/obidos/tg/detail/-/0672326116/ref=wl_it_dp/104-3642197-1495100?%5Fencoding=UTF8&coliid=I4HBKLOUR8170&v=glance&colid=2RAZ56R6CY2MT Refactoring: Improving the Design of Existing Code http://www.ama...more >>

Error Reading the Security Log
Posted by Tom at 5/9/2005 1:16:07 PM
I am getting this error when I try and read the events in the Security log. A required privilege is not held by the client! My web site is set up as Integrated Authentication and in my web.config I have the following <identity impersonate="true" /> Since I am an Admin on my box and on t...more >>

EventlLog - How to Query all the different logs
Posted by Tom at 5/9/2005 1:15:31 PM
Is there an object that I can query that will return to me the different logs in the EventLog? I know by default there exist a System, Security and Application Eventl log. But, I'd like to bind all the different logs dynamically to a dropDownList control. Just not sure which object to u...more >>

Accessing UI controls from non-gui thread
Posted by Flack at 5/9/2005 1:10:06 PM
Hello, Are there any tools available that would help in finding out if any gui controls are being incorrectly accessed by a thread which doesn't own the control?...more >>

StringBuilder substring
Posted by Dave at 5/9/2005 12:44:24 PM
Substring returns a given string from a string. Is there an equivalent way to get a substring from a StringBuilder?...more >>

Sending Null Value to Sql Server
Posted by Robert at 5/9/2005 12:44:13 PM
I need to be able to send a null value into a Sql Server datetime field. The follolwing code is a snippet of what I am using. I am parsing a flat file from the main frame and inserting it into a Sql DB. The "departDate can be a null value in Sql Server. I cannot figure out how to assign a ...more >>

C# & VB in same project.
Posted by farseer at 5/9/2005 12:27:57 PM
Hello, with VS2005 BETA, is it possible to use multiple languages in the same project? For instance, can i have project with certain classes implemented in VB and others with implemented built in C#? thanks ...more >>

ControlDesigner for TabControl
Posted by Rachel Suddeth at 5/9/2005 12:17:02 PM
I would like to write a designer verb for a class I have that inherits from TabControl. I figure the only way to do that without breaking the special designer stuff that works for TabControl would be to inherit from whatever Designer class is currently used for the TabControl. But I can't find ou...more >>

Where does Application.ProductVersion
Posted by Rachel Suddeth at 5/9/2005 12:12:00 PM
I think it will be the AssemblyVersionAttribute from the executable assembly, but I can't seem to find that documented anywhere... In fact, it does seem to be showing the same value as AssemblyVersion from the executable assembly, so I'm pretty sure that it at least defaults to that... but is ...more >>

DataGrid double-click detection
Posted by mdb at 5/9/2005 12:09:37 PM
I need to detect when the user double-clicks on a cell in a DataGrid in WindowsForms, but the doubleClick event doesn't seem to respond when its in the data area. (It does respond if I double click the row header.) Any suggestions? -mdb...more >>

can't read <add> in config file
Posted by frederic at 5/9/2005 11:56:36 AM
When I try reading an <add> markup with ConfigurationSettings.AppSettings, I get an error message saying it can't fint "key" attribute. I get this problem on one machine, not the other one. Does anybody have any idea? We have .net 1.1 SP1 thank you ...more >>

converting vb to c#
Posted by Newbie at 5/9/2005 11:54:04 AM
I'm having trouble converting the following, pls. help. Thanks in advance. sLPN = "SELECT Convert(last_project_no,'US7ASCII') FROM pa_control FOR UPDATE " Set rsLPN = db.Execute (sLPN) While not rsLPN.EOF Session("LPN")="" lpn = rsLPN(0) rsLPN.MoveNext wend ' STORE LAST_PR...more >>

Another try - inserting datset into sql
Posted by a at 5/9/2005 11:28:07 AM
NEW Post Here's my best guess at how to insert this dataset.... the code runs, but no new records are added to the sql table. I've read and split a delimited text file into a dataset. It looks fine in a datagrid (5 columns and 5,000 rows), but I've been trying, without success, to then i...more >>

System.Convert.ToDateTime issue
Posted by Tim Cowan at 5/9/2005 11:24:51 AM
Hi I am using System.Convert.ToDateTime to convert a date from a DB to datetime type. The only trouble is it works one way on my local computer and another way on our production server. Being located in Canada I get: 4/13/2005 for April 13 2005 Our production server also located in Canada...more >>

"Add Inherited Form" Missing from Visual C# Express Beta 2?
Posted by Dave Munger at 5/9/2005 11:20:44 AM
Apologies if this is a known issue, but I couldn't seem to turn it up with google or on Technet. I am using Visual C# 2005 Express, Beta 2. I am learning C# and have come to the point in the book I am reading, which covers form inheritance. Granted, the book is for Visual Studio 2003, but it...more >>

Display menu on notifyIcon with left mouse click?
Posted by mdb at 5/9/2005 11:16:45 AM
My app has a notify icon in the systray. I want the left mouse click to initiate a menu, and a right-mouse click to do something else. Normally, for a button, I would listen to MouseDown and if I need to display the menu, I would contextMenu.Show(buttonCtrl, new Point(0)). But I can't do ...more >>

vb to C#
Posted by Newbie at 5/9/2005 10:25:03 AM
I am converting a vb code to c#. I already converted most of the code except for: lpn = rsLPN(0) How do you convert the above code. It's probably easy but I cant figure it out. The entire code follows: sLPN = "SELECT Convert(last_project_no,'US7ASCII') FROM pa_control FOR UPDATE " ...more >>

DataGrid numerical sorted instead alphanumerical...
Posted by Josema at 5/9/2005 10:18:02 AM
Hi to all, I have a datagrid filled with string values, and when i click in a header column the datagrid is alphanumerical sorted , but i need sort some columns by numeric way... The datasource of this Datagrid is a DataView, that is a View of a DataTable (using the property of the data...more >>

Colored SQL Editor
Posted by Ash at 5/9/2005 9:47:20 AM
Does anybody know how to change a multi line textbox or a richTextBox to sort of a smart sql editor (Colors reserved words..etc)? Is there an open source component somewhere that can be used? Thanks,...more >>

Loading a form
Posted by juli jul at 5/9/2005 9:38:31 AM
Hello, I created a form and excpected to see in a windows designer generated code something like this: this.Load += new System.EventHandler(this.Form1_Load); as I saw in other projects. But I don't see it and I need it in order to do things while the form loading. How can I add it and where...more >>

Where to put global compiler directives?
Posted by Selden McCabe at 5/9/2005 9:19:46 AM
I would like to have a compiler directive to switch on or off some code in several different places. Is it possible to define a compiler directive (#define BUILD_RESOURCES) somewhere and have it apply to all forms and classes? I tried putting it at the top of global.asax, but that didn't ...more >>

Is this good use of Properties?
Posted by Brett at 5/9/2005 9:17:09 AM
If I do this without declaring a corresponding field, is it considered bad design? What are the advantages or disadvantages to either method? Notice there is not set. public string URL { get { return "www.somewhere.com/test.aspx"; } } vs. a more common approach: ...more >>

Selecting Row in a DataGrid when a Cell is Selected
Posted by orekinbck NO[at]SPAM yahoo.com.au at 5/9/2005 8:42:59 AM
Hi There I have a datagrid whose main purpose in life is to provide a nice way for users to make a single choice from a list. The grid is read only, single row select and has its data source as an ArrayList. I came up against the issue of selecting a cell and getting the whole row to highl...more >>

docking problem(form)
Posted by juli jul at 5/9/2005 8:17:32 AM
Hello, I need to place those controls in the form in the order that I am writing: 1)ListView (aligned dock to "Fill") 2)Spliter aligned to left(dock=left). 3)TreeView aligned to left(dock=left). How can I do it? (I tried to add them first without docking in the order 1),2),3) but after...more >>

Named parameters?
Posted by Ben R. at 5/9/2005 8:12:14 AM
I'm reading about attribute classes and specifically, named versus positional parameters. Was this implimented instead of multiple constructors for flexibility or is there another reason I'm missing? -Ben...more >>

trying to add class library dll to COM+ component package
Posted by jason at 5/9/2005 7:10:24 AM
i have a c# class library that is being compiled with the "Register for COM Interop" flag set to "True." it compiles just fine. however, when i go into the Component Services administrative tool and attempt to add the .dll to an application, i get the following message: "One or more files do n...more >>

How to display running app's like in task manager
Posted by fperfect13 at 5/9/2005 6:42:29 AM
Hi, I want to display all windows applications(not proceses) like in task manager. I haven't found any example of this either using WMI or System.Diagnostics. How can it be done in c#? Thanks. ...more >>

Serialization of an object
Posted by fperfect13 at 5/9/2005 6:37:40 AM
The problem is like this: I have a class C1 which has a private field "private Graph graph;" accesed by a property(C1.Graph). The class Graph is serializable but when i pass to a method that serializes a Graph object C1.Graph it gives an error saying that C1 isn't serializable. The project...more >>

How to know when system is shutting down?
Posted by mdb at 5/9/2005 6:28:12 AM
I have an app that I want to keep open (and hidden with an icon in the taskbar) when the user presses the 'X' close window button. So I capture the Closing event on the form and check a bool variable, which if set, sets e.Cancel on the ClosingEventArgs and sets the Form.Visible=false and the ...more >>

Setting SetSockOption Socket
Posted by Jasleen at 5/9/2005 6:00:08 AM
I am setting NoDelay on Socket using SetSocketOption method so that I dont get merged packets and reves coalescing.But after some packets the receving side gets merged data for 2- 3 packets. I have TCPip socket. sock.SetSocketOPtion(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1) But ...more >>

HTTP 403 Forbidden
Posted by BuddyWork at 5/9/2005 5:59:05 AM
Hello All, I'm using VS2003.NET Framework 1.1 with Microsoft Application Center Test. I am doing stress testing on a webservice. The method of the webservice has the following code. [WebMethod(MessageName="Connect", Description="Connects to the session.")] public Guid Connect() { ...more >>

sorting a datagrid
Posted by Newbie at 5/9/2005 5:50:04 AM
Hello! I need help in making my datagrid sortable by clicking a column header. In the datagrid's property builder, Allow Sorting is checked. I am using a Bound column and it's Sort Expression is set to the same value as the Data Field value. But I dont know how to implement: private voi...more >>

File.Copy - file with css extension
Posted by karen.mcdonagh NO[at]SPAM singularity.co.uk at 5/9/2005 5:45:51 AM
I am trying to copy a file with a css extension using the following code if (!DoesDirectoryExists(sLocation)) { //Create the directory Directory.CreateDirectory(sLocation); } FileInfo test = new FileInfo(sFile); test.CopyTo(sLocation, true); The location is c:\test.c...more >>

input from a web form
Posted by Pierre at 5/9/2005 5:11:30 AM
Hi, I try to get some input from a web form using the POST method, but somehow with my code the variables are never empty. My form: <form class="specs" method="post" name="Form" action="WebForm1.aspx"> <div>Login: <input class="login" type="text" name="Login"></div> <div>Password: <inp...more >>

Intellisense not working for NumericUpDown.Text
Posted by Andrew Ducker at 5/9/2005 3:00:47 AM
Strange one happening with VS 2003. If I put a numericupdown on a form and then type the following: string myString = this.numericUpDown1.Text; then after the "." the intellisense pops up - but it _doesn't_ have Text - the closest it has in the list is TextAlign. However, if I choose that an...more >>

Difference between WBEM and WMI
Posted by sushi at 5/9/2005 2:16:09 AM
Hello, I want to monitor a remote server from my machine. I wanted a know whether to implement out own WBEM is good solution or to use Microsoft's implemented version WMI(System.Management) is useful. What ar pro's cand con's of both. Regards, ...more >>

How to monitor and manage remote server
Posted by sushi at 5/9/2005 1:24:03 AM
Hello, I have to monitor a remote server for functions such as CPU Utilization etc. I am using System.Management namespace for the same. But when I try to execute the following code, it gives System.UnauthorizedAccessException though the user which I have provided is a valid do...more >>

Where is "Add Inherited Form" in Beta 2?
Posted by camsight NO[at]SPAM gmail.com at 5/9/2005 12:53:48 AM
Hi, all! I've just downloaded and installed Visual C# Express 2005 Beta 2. I can't find "Add Inherited Form" menu which existed in Beta 1. Is it gone now or is it just only my problem? Thanks. Sam ...more >>

Translate accented characters
Posted by JezB at 5/9/2005 12:00:00 AM
Is there anything in the framework which will help translate accented characters in strings to their standard counterparts? eg. "Gráda" to "Grada" ...more >>

array list
Posted by Hrcko at 5/9/2005 12:00:00 AM
How to get a list of items from listBox into array ? Hrcko...more >>

An object reference is required for the nonstatic field, method, or property
Posted by Vicky via DotNetMonster.com at 5/9/2005 12:00:00 AM
Hi, I need help with "An object reference is required for the nonstatic field, method, or property 'dataReader.Class1.data'" Before I put folowing variable in class level, it works fine. ------------------ string[] data; string valTicker = ""; string valPeriod = ""; --------------------- b...more >>

Can someone please help me with RegEx?
Posted by Julia at 5/9/2005 12:00:00 AM
assuming I have template HTML file which contains property names to evaluate at run time <HTML> <BODY><%PropertyName1%> <DIV ID="<%PropertyName2%>"> </HTML> How do I find all matches for <%...%> ,i dont know which pattern to use. string pattern=""; string input="....."; Re...more >>

C++ vs C#
Posted by TStoltz at 5/9/2005 12:00:00 AM
Hi, I'm sorry if this question comes inapropriate but hope you can help me answer the following: What is the difference between C++ and C#. Can I use C++ code within the C# code. I've heard postive things about Framework which should be similar to MDSN - or what is it better/worse? Pl...more >>

Mailto: Attachments not Working
Posted by Harsh Vardhan Singh at 5/9/2005 12:00:00 AM
I am not able to attach files using mailto: command I am using mailto: something@something.com?Subject=test&attach=c:\test.txt i have tried all variations of path c:\\test.txt 'c:\test.txt' "c:\test.txt" ...more >>

Unlimited parameter list
Posted by Joe at 5/9/2005 12:00:00 AM
I want to create a method similar to Console.WriteLine where I can pass in an unlimited parameter list. I know how to do this in C++ but have no clue in C#. Thanks for any help, Joe ...more >>

I am looking for an implementation of fowler's Template View pattern
Posted by Julia at 5/9/2005 12:00:00 AM
Hi, I need to send HTML messages and embedded properties which set by the user I would like to use fowler's Template View pattern,does any one implemented it? Thanks in advance. ...more >>

sign assembly
Posted by Boni at 5/9/2005 12:00:00 AM
Dear all, I use 3-d party assembly in my project. This assembly is not signed. Now I added to my project a AssemblyKeyFileAttributefor my assebly.As the result of that, I get a error: error BC30145: Unable to emit assembly: Referenced assembly 'Interop.XXXX' does not have a strong name I...more >>

Custom action not working
Posted by Claire at 5/9/2005 12:00:00 AM
Hi I've created an installation package for my Service application. This is my first attempt at an install package. In the simplest install package, the files are being created in the target directory ok. InstallUtil.exe is one of these files. I've now tried to add a custom action (I've tried...more >>

remove from listBox
Posted by Hrcko at 5/9/2005 12:00:00 AM
How to remove a selected item from listBox? Hrcko...more >>

Web service 'Access to the path denied'
Posted by Danko Greiner at 5/9/2005 12:00:00 AM
I need to setup WebService so it can read/write folder e.g. SharedFolder When i setup sharing permissions & security for ASPNET user, it's not enogh. When i setup for Everyone (local or domain) WebService works fine. what do i need to do? what is the right way to set it up? is webservic...more >>

Excel
Posted by samos at 5/9/2005 12:00:00 AM
Hi Do you know a good way for operating on excel files from c# application? I made one lately but unfortunatly it appears that it only works with Office 2003 and I would like it to work with every office. Is there a way to make one code work with all version of office? samos ...more >>

Getting Assembly Name
Posted by Srinivas Kollipara at 5/9/2005 12:00:00 AM
Hello All, I am having problem to get the executable name while accessing a method, Is there anyway we can get that name in C#. thanks in before. -- Thank you Srinivas L.Kollipara Strata Solutions, 1400 BattleGround Ave, Greensboro NC 27408 Ph: (336) 691-1190 Ext. 118 ...more >>

How can we identify the size of file in C#.NET
Posted by Mamatha at 5/9/2005 12:00:00 AM
Hi I am developing a small application,in that application i have small doubt,that is can we identify file name while at the time of creating a file. If possible please let me know,Otherwise,how can we know the size of file if we give file path? Please give me solution. Thanks in advan...more >>


DevelopmentNow Blog