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 2004 > threads for tuesday june 8

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

How to map all changes of a dataset to the original database?
Posted by moonriver at 6/8/2004 11:46:02 PM
It seems that a C# program can not update the original database by mapping all the changes to the dataset, but have to explicitly assign the InsertCommand or UpdateCommand properties of a SqlDataAdapter instance. Look at the following codes about inserting a few records into the country table ...more >>

How to generate a variable-length array in C#?
Posted by moonriver at 6/8/2004 11:31:03 PM
I intend to generate a variable-length array, similar to link lists in plain C. For example, I define the following array int [] a Initially I assign 5 elements to the array as a = new int[5] for( k = 0; k < 5; k++ a[k] = k Then I want to expand the array to 7 elements without discardin...more >>

Draw a one pixel point with GDI+
Posted by Pat Keel at 6/8/2004 9:29:25 PM
Hi there, I'm looking for a solution to draw a one pixel sized point to a graphics control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10, 10,10) has no effect. How to do? Thanks Pat...more >>

Stretching an image
Posted by Dougie at 6/8/2004 9:17:59 PM
How would I stretch an image in a C# application to span the full width of the screen? Basically I've got a header logo and then a spacer image that I want to use to fill the width of the screen. Also does anyone know how to resize the background image instead of having it tiled in a window...more >>

Draw on pixel point with GDI+
Posted by Pat Keel at 6/8/2004 9:12:31 PM
Hi there, Im looking for a solution to draw a one pixel sized point to a graphics control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10, 10,10) has no effect. How to do? Thanks Pat ...more >>

Help with registry, array, and listbox
Posted by vbMark at 6/8/2004 8:52:35 PM
Hello, In regards to the Registry... Can someone give me an example of how to list an unknown number of subkeys under a key, and put the key names in one column of a listbox, and the key values in another column of a listbox? Thanks!...more >>

Catching every unhandled exception?
Posted by Elp at 6/8/2004 8:44:27 PM
Hi, I've developped a Window Form C# application which main form contains several activex controls. No problems most of the time but on some machine, the application crashes when the main form is closed with a NullReferenceException caused by the DisposeAxControl which, i guess, is supposed t...more >>

Simple read files and write file
Posted by Phil396 at 6/8/2004 8:37:16 PM
I have to create a simple program but I want it to look as professional as possible. The program needs to open a file on a network share write the contents of a number of files to one file. The files will contain many lines with a carrige return at the end of each line. Each file will have the...more >>



Two questions about System.Diagnostics.Process.Start function
Posted by ginee lee via .NET 247 at 6/8/2004 8:15:34 PM
(Type your message here) hi all, It seems that the arguments of System=2EDiagnostics=2EProcess=2EStart()= can only be the absolute path=2E The args can not be like= "=2E\abc\efg=2Eexe" or "=2E=2E\abc\efg=2Eexe"=2E While i use relative path,= the function doesn't work=2E Any solution?? T...more >>

distinct
Posted by frazer at 6/8/2004 6:18:48 PM
hi i have the following 2 typed datasets. 1."SecurityGroupMembership" LoginName GroupId 2."Users" LoginName Password Fname Sample data loginname groupid user2 8 user1 1 user1 2 i have 2 listboxes selected and notselected i populate selected list box with loginna...more >>

Event bubbling in WinForms???
Posted by Sreekanth at 6/8/2004 5:56:56 PM
Hello, I want to bubble an event to the parent control. i.e if there is no event handler in my control then that event has to be passed to the parent control. If the parent has the event handler it should handle otherwise it should bubble to its parent. How can I do this? My requirement is to h...more >>

how to generate a list a alphabet using csharp?
Posted by one at 6/8/2004 5:56:02 PM
greetings i am just wondering if some expert here can either show me how to do this or point me to the right direction (url... i want to use c# to generate a list of alphabet e.g A B C ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZ any suggestion will be greatly appreciated thank you on ...more >>

MMC and .NET 2.0?
Posted by Claus Konrad at 6/8/2004 5:48:02 PM
Hello Any support for developing MMC-snapins in the .NET 2.0 framework?? /Claus ...more >>

Notify Events to Parent
Posted by anand at 6/8/2004 5:22:59 PM
Hello, I have created a Custom Windows Control in C# (.NET 2003). I have a PictureBox in that control. I want to expose the single MouseMove event of the control to the client. So that the MouseMoveEventHandler from the client will know where the mouse is. Is there any way to send the Pi...more >>

Enumerate terminal servser sessions using C#.
Posted by Moses M at 6/8/2004 5:20:25 PM
I am new to C#! I need to enumerate TS sessions (including sessions running in non-application mode) using a C# application. Can this be done using a "TS-WMI" provider? Any input will be appreciated! Moses ...more >>

StringBuilder
Posted by Paddy at 6/8/2004 5:17:49 PM
An code example says StringBuilder x = new StringBuilder(); This will not compile, please comment. Paddy ...more >>

Encoding.Default and Encoding.UTF8
Posted by Hardy Wang at 6/8/2004 4:27:18 PM
Hi, I have following code: Encoding mode; // Encoding.Default or Encoding.UTF8 FileStream sb = new FileStream(fullPathAndFileName, FileMode.Create); StreamWriter sw = new StreamWriter(sb, mode); sw.Write(textContent); sw.Close(); My question is under what situation, the saved files are diff...more >>

Exel like worksheets using a database
Posted by Lane at 6/8/2004 4:16:02 PM
Im looking for a way to manipulate data in a spreadsheet like environment, i have tried datagrids but i dont want to have to click a button to edit a field. I am doing a inventory count form and want to enter the number counted into a field in the form then do calculations on that informatio ...more >>

converting an array of bytes to an array of chars
Posted by Claire at 6/8/2004 4:14:19 PM
I need to convert an array of bytes into an array of chars so I can initialize a string without using unsafe methods and I thought of using the following overload of the constructor. public String(char[]); private byte[] TempBuff = new byte[Buffsize]; // read in bytes from serial port and va...more >>

Execute a Window Application in Command Line
Posted by Joey at 6/8/2004 4:00:44 PM
I want my window application to run also in command line mode. When the application activated from the command line console, it should notify the console whether it succeeded or failed Is it possible to set the output stream of a window application to the command line (cmd.exe process)? ...more >>

How to uninstall a program?
Posted by Adam Clauss at 6/8/2004 3:43:51 PM
I am needing to automate some installation tasks. I first need to determine if there is already a version of a program installed. The program appears in the Add/Remove Programs in control panel, and I know this is all stored in the registry. But short of searching through the entire registry, ...more >>

Call Win32 GetOpenFileName from C#
Posted by SS at 6/8/2004 3:09:26 PM
I tried a sample code provided in Microsoft .NET on how to make a call to Win32 GetOpenFileName. It crashed if I call the function, select a file and close the dialog and repeat the process several times.. I got the following error : An unhandled exception of type 'System.NullReferenceExceptio...more >>

Problems with asp:button
Posted by Maziar Aflatoun at 6/8/2004 2:00:22 PM
Hi everyone, I have the following shopping cart (basket view). However, Delete button in my datagrid doesn't fire any events. Does anyone know why? (It's a user web control) <%@ Control Language="c#" AutoEventWireup="false" Codebehind="ShoppingCart.ascx.cs" Inherits="TPShoppingCart.Sho...more >>

PrintDocument ?
Posted by john sutor at 6/8/2004 1:59:33 PM
I am trying to print a simple document (.txt) from my drive. I tried using the following code to no avail. This cannot be that hard. In VB this was easy, Why does C# make it so hard? Can anyone help me solve this. I ran the code from the clikc event of a button PrintDocument prnDc = new P...more >>

How to get access to the current row number being output from database.
Posted by amiwebguy NO[at]SPAM yahoo.com at 6/8/2004 1:50:06 PM
I'm a newby to C#, but in ColdFusion I've used <cfif #currentrow# Mod 2 is 1>. Here is my C# code that's looping through the data. Do I have to write my own counter or is there some way to access the row number? while (objDataReader.Read() == true) { strResultsHolder += "...more >>

Windows Explorer API or Namespace??
Posted by Steve Randall at 6/8/2004 1:41:04 PM
I am building a utility application that uses much of the same functionality as already exists in the Windows Explorer. It would therefore make sense to use (if possible) the Windows Explorer as the base component for my application. Since some of the treeview functionality of Windows Explorer is us...more >>

Move splitter
Posted by MFRASER at 6/8/2004 1:15:07 PM
How do I move the splitter inside of code. if(TypeA) { this.pnlHXMLList.Visible = false; this.splTop.is.Top = 65; } else { this.pnlHXMLList.Visible = true; this.splTop.is.Top = 165; } ...more >>

signed assembly
Posted by cs at 6/8/2004 1:06:17 PM
is there a way to check trhough c# code if an assembly is signed and if it has the same signature as another assembly? I have some code that uses reflection on some types that belong to some assemblies that are loaded on runtime however I want to make sure the assemblies are signed with our key!...more >>

Detecting EventHandler
Posted by Eddy POULLET at 6/8/2004 12:34:35 PM
hi, I have a control with an event handler this.Button.Click += new System.EventHandler(this.FormData_Changed); Apparently the code below is not compilable if ( this.Button.Click != null) // CS0079 { .... } Question : How can I known if a (or how much) handler exists for an even...more >>

Looping through all controls on a webform
Posted by Hai Nguyen at 6/8/2004 12:33:40 PM
I have another question. I'm trying to loop through all the textboxes on a web application. The snippet is below //foreach(WebControl ctr in Page.Controls) foreach(Control ctr in Page.Controls) { if(ctr is TextBox) { TextBox t = (TextBox)ctr; t.BackColor = Color....more >>

weird changes in method signature
Posted by Bamse at 6/8/2004 12:06:01 PM
Hi, I've noticed that if in a webservice method, I use an enumeration or a struct of my own, in the project that references that webservice, the method's signature is changed, e.g: proj1: public struct S1 { public string Member1; public int Member2; } ws_proj { DoSometh...more >>

safely stopping threads
Posted by 2G at 6/8/2004 11:43:56 AM
Hi I'm trying to safely stop a thread but as you might have guessed, I'm failing at it. GetCurrentThread seems to get the wrong handle, my form disappears when I try to stop the thread and it looks like the thread keeps running. Does anyone know how to get the correct handle or a better way t...more >>

Sharing encrypted data with .Net?
Posted by tgruben NO[at]SPAM flightlock.com at 6/8/2004 11:18:30 AM
I am trying to send some encrypted data from a php application to be decoded in a .Net application. Both apps encode/decode a given string but generate different encrypted results. Anyone have any idea? Code to follow: php====> <?php // Designate string to be encrypted $string = "This i...more >>

Listview / databinding
Posted by Paddy at 6/8/2004 11:14:09 AM
In the case of a listView, how would the lines below have to be altered? Thanks, Paddy private void MainForm_Load(object sender, System.EventArgs e) { City [ ] cityChoices = {new City("Cardiff", "Wales"), new City("Farnborough","UK")}; listBox1.DataSource = cityChoi...more >>

Delegate
Posted by Hai Nguyen at 6/8/2004 10:48:23 AM
I don't know if any body got any error similar to this " G:\DelegateExample\DelegateDemo.cs(44): Inconsistent accessibility: parameter type 'DelegateExample.DelegateDemo.Operator' is less accessible than method 'DelegateExample.DelegateDemo.Run(DelegateExample.DelegateDemo.Operator, System.C...more >>

Printing a document
Posted by john sutor at 6/8/2004 10:47:20 AM
How can I print a simple document using the printerDocument and PrintPreviewDocument objects. PLEASE do not send me to the Microsoft example - It does not work and the explanation is very loose! ...more >>

XML Schema Validation
Posted by Rahul Aggarwal at 6/8/2004 10:21:14 AM
Hi, How can you validate an xml document against a schema in c#. Thanks Rahul ...more >>

Question about the scroll arrows in DataGrid
Posted by Gidi at 6/8/2004 10:06:02 AM
hello i have a DataGrid table and by the help of Adnan, here in the forum, i have the Mouse_up Event that by Clicking a row on the dataGrid it's selectes the whole ro the problem is when i'm pressing the scroll arrows (to move the rows up\down\left\right) the whole stays selected except the cell w...more >>

Regular Expression
Posted by christian strevel at 6/8/2004 10:00:45 AM
I need to extract this from a subject: [groups] Which will be the correct RegExp? ...more >>

Problems problems problems with GetProcessesByName(ProcessName,this.IPAddress)
Posted by Lord Fonty at 6/8/2004 9:56:29 AM
Hi All I posted this recently and no one responded so I am wondering if there are any guru's out there whould could help me: > I keep getting the above message when using > GetProcessesByName(ProcessName,this.IPAddress) > > Does anyone know why? Anyone help with this I am pretty lost an...more >>

Couldn't get process information from remote machine
Posted by Lord Fonty at 6/8/2004 9:54:32 AM
I posted this recently and no one responded so I am wondering if there are any guru's out there whould could help me: > I keep getting the above message when using > GetProcessesByName(ProcessName,this.IPAddress) > > Does anyone know why? Anyone help with this I am pretty lost and I can't ...more >>

NewLine in a textbox
Posted by JC at 6/8/2004 9:42:30 AM
I can't get \n to work in a multiline textbox, what do I need to do? If I need to add a hard return then what is that sequence. jc ...more >>

Console.Writeln not outputing
Posted by Mark Overstreet at 6/8/2004 9:36:01 AM
I am creating an asp.net app and all I am trying to do is Console.Writeln(somevariable) but this does not should up in the output window? I feel pretty stupid but does anyone have any idea why I can't print out the contents of a variable Thank Mark...more >>

Close form
Posted by john sutor at 6/8/2004 9:32:34 AM
When the "X" is selected in the upper right-hand corner of a form, what event is fired? ...more >>

Abstract class / interface?
Posted by Beeeeeeeeeeeves at 6/8/2004 9:31:05 AM
What's the difference between the two? Any?...more >>

Why can't I enumerate a DataViewRow?
Posted by Bill at 6/8/2004 9:21:22 AM
This test is generating a compile error: private void BuildFTPRec(DataRowView a, DataRowView h) { foreach (DataRow r in a) { foreach (DataColumn dc in r) { Console.WriteLine(r.ToString()); } } } The error is: C:\Data\projects\TwsFtpOutT...more >>

DateTime and remove days
Posted by MA at 6/8/2004 9:08:13 AM
Hi all! I use datetime to navigate in a calendar i´ve made. There is no problems navigating forward (AddDays()), but how do i remove days from DateTime? I would love to have something like this: DateTime start = DateTime.Today; if(forward) start = start.AddDays(6) else start = st...more >>

How to use SPLITTER ?
Posted by pronto at 6/8/2004 9:00:51 AM
Hi All, C#. I want create simple not resizable form with List and Tree controls and make them splittable. List on left side, Tree on the right side. That's what Splitter for , right ? How to use splitter in this simple case ? regards pronto ...more >>

ArrayList help needed
Posted by Bernie Walker at 6/8/2004 8:57:39 AM
I am retriving a list of headers from a news server. I create an array that contains the elements of the news header and add it to an arraylist. After I have collected all the headers and added them to the arraylist, I sort the arraylist on the 'article subject' element of the arrays. This all w...more >>

.Net Source
Posted by Alexander Muylaert at 6/8/2004 8:26:23 AM
Hi I heard from someone that it is possible to download the source of certain classes from .net. Anybody has an idea where? kind regards Alexander ...more >>

How to program USB port?
Posted by EdgarBM at 6/8/2004 8:23:53 AM
Hi, I think it's a simple question, but I need a light to follow... It's an easy question: how may I program the USB port? maybe it's better to say, where can I find sample codes or complete developing manuals? Thank you in advance, Edgar...more >>

Newbie Question: Cookies and struct compatibility
Posted by ansley03 NO[at]SPAM hotmail.com at 6/8/2004 8:08:17 AM
Sorry if this is vague, but I am trying to create a struct that stacks infomation from a cookie class I created and then populates a set of text boxes with user information. I really want to know if this is even possible. I will try to supply more information if needed. Thanks....more >>

Programatically using Datasets
Posted by Brian Conway at 6/8/2004 7:33:27 AM
I am trying to dynamically generate a dataset that pulls back information based off of a login id, once it has the dataset I want to take information from the dataset and populate editable fields on a form. So far I know that the click event works based off of the login id, because I can get a ...more >>

What is the best way to zero pad a numeric field?
Posted by Bill at 6/8/2004 7:04:02 AM
I have a decimal value that needs to be written to a file for input into a COBOL program. The format of the COBOL input value is 9(9)V99. IOW, this is an eleven byte field with an implied decimal. Thus a decimal value of 109.52 would need to be formatted as 00000010900. What is the most effici...more >>

Udp multicast receive problem c#
Posted by mjcast at 6/8/2004 6:51:45 AM
i am writing an ActiveX control in c# that connects to a multicast. It works properly the problem is that when i run my webapp that contains the ActiveX control, then the broadcast is sent i do not receive the datagram for a minute and fourty five seconds. I need to be able to receive that datagram ...more >>

MatchEvaluator
Posted by Beeeeeeeves at 6/8/2004 6:41:07 AM
Is there ANY way to cause a MatchEvaluator delegate to just *stop matching* i.e. DON'T call this function any more, for the current Replace() call Similar to the way in which you would return false from an EnumWindowsProc, to not process any more windows for the current call of EnumWindows Than...more >>

Copying a file from a server to a client
Posted by kwydra at 6/8/2004 5:20:44 AM
I'm pretty new to the .net framework so hopefully this question will be easy. I need to create a document management style client/server application that provides the following functionality: There is a secure file structure on a network that end- users do not have direct access to. I ...more >>

Abstract Classes and Forms
Posted by Steve at 6/8/2004 5:16:03 AM
using VS 2003 Is there a solution/work around //the following, and all variations, creates a compile erro abstract class MyAbstrac { ... public class Foo : System.Windows.Forms.Form, MyAbstrac { ... / this doesn’t create a compile error but the “designer” hides the form and giv...more >>

A strange behaviour of GotFoucus Event
Posted by Qumer Mumtaz at 6/8/2004 4:46:06 AM
hi Al I am using a data grid there is a date time picker control in one its columns.I wanna do something on GotFocus vent of DateTime Picker Control.But the thing that is very strange (rather annoying) is that when the control got focus the evnt is fired not for once but for one GotFocus event it f...more >>

Loose Threads
Posted by Michael C at 6/8/2004 3:53:31 AM
Thank you all for all your help. My projects are chugging along now. I have one more quick question, if you don't mind. I'm calling the WTS API function WTSSessionEnumerate() multiple times on multiple worker threads using asynchronous delegates and callbacks. Everything seems to work fine, ...more >>

Changing only a specific line of a textbox
Posted by prelugejunk NO[at]SPAM hotmail-dot-com.no-spam.invalid at 6/8/2004 3:22:52 AM
I'de like to change only a specific line of a textbox. Right now I am doing: string[] texta = mainTextBox.Text.Split( "\n".ToCharArray() ); for ( int i = 0; i <= texta.Length-1; i++ ) { if(i == myLine) mainTextBox.Text += "My New Text For This Line\r\n"; else if(!(texta[i].Equal...more >>

Str Like IN C#
Posted by do cang via .NET 247 at 6/8/2004 2:04:37 AM
(Type your message here) -------------------------------- From: do cang public static bool StrLike(string values,string patern) { patern=patern.Replace("*",@"(\w){0,}"); patern=patern.Replace("?",@"(\w){1}"); patern="^" + patern + @"\z"; return System.Text.RegularExpressions.Re...more >>

Regular expression for validating phone numbers
Posted by seash at 6/8/2004 2:01:07 AM
Hi I need a regular expresssion which validates any kind of Phone numbers format..irrespective of the Country need hel ---seash...more >>

Paste, RichTextBox
Posted by Beeeeeeeeeves at 6/8/2004 2:01:04 AM
How can I ensure that only plain text is pasted into a rich text box? No different sized text, no pictures...etc. Thanks...more >>

Referencing a Project
Posted by GeRmIc at 6/8/2004 1:41:03 AM
Hi I am adding a .NET Class library to an existing C DLL (using the VC2003.NET IDE), i've added the reference for the new .NET library in the existing code and also used using namespace GenSOAP; at the begining of the DLL file but whenever i call any function in the .NET Library from the C DLL it ...more >>

Setting width of a column in a DataGrid
Posted by TT (Tom Tempelaere) at 6/8/2004 1:31:04 AM
Hi l&g It's weird but I can't find an easy way to set the width of a column in a DataGrid. It must be hidden somewhere. I searched google but it's all vb-ish and not to the point. Can someone sketch me how I should do this What I actually want to do is to specify the width of a column relative t...more >>

Win32 API -- scrollWindow help
Posted by 50230065 NO[at]SPAM alumni.cityu.edu.hk at 6/8/2004 1:30:09 AM
to all I want to know how to use Win32 API -- scrollWindow, as I read the descriptions from MSDN, it can add scrolling capability to controls. Is it possible to apply scrollability only to a small part of the form? ------------- | __ | | | | | | -- | |___________| ...more >>

Security Error
Posted by Michael C at 6/8/2004 1:07:56 AM
I just noticed something else odd. When I run my apps locally, they run fine; but the same app copied to and run from a mapped network drive gives me security errors. Anyone know what's going on with that? Thanks, Michael C ...more >>

newbie: Generating dynamic labels?
Posted by R at 6/8/2004 12:36:55 AM
Hi. I need to generate a bunch (100) of lables to use in my application. I'm sure there is a smarter way, than using the designer in VS... Can some one fill in the missing part? (having a private System.Windows.Forms.Label foo;) [in constructor] this.foo = new System.Windows.Forms.Labe...more >>

Here's an Interesting 2 Questions
Posted by Michael C at 6/8/2004 12:13:41 AM
1. Is there any way to retrieve the name of the locally running SQL Server? The reason I ask is that I'd like to retrieve the name of the default SQL Server and all named instances, but only on the local machine. 2. Is it possible to copy a file to a specified directory on a remote machine w...more >>


DevelopmentNow Blog