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 thursday june 10

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

Enum validation question
Posted by Hans De Schrijver at 6/10/2004 10:29:17 PM
Im puzzled by a data validation behavior I don't understand, related to enums. Stripped down scenario: enum Type {One=1, Two=2, Three=3} Type var1 = (Type)40; These two lines of code don't cause a compile error. In VB, trying to assign a value to a variable of an enum type does cause a ...more >>

Specific file format creation
Posted by Mike at 6/10/2004 9:47:01 PM
Hi, I have a NNTP client application. How is it possible to convert = character that I received within a "Content-Type:" into the specific = file format specified in the content type? I tried to copy and paste the data I received, but it obviously did not = work :-) Thanks Mike...more >>

Scrollbar Events
Posted by Qumer Mumtaz at 6/10/2004 9:03:02 PM
hi In vscroll bar I want to differenciate between Upper or Lower scroll buttons. Just say when user press top button a message is displayed "Top is pressed" and when lower button is pressed message is displayed "Buttom is pressed" is there any event to do this? ...more >>

Visual C# question....
Posted by Beringer at 6/10/2004 7:51:08 PM
I know this forum is for the language but i haven't found a Visual C# forum so I thought I would ask my question here. I have Visual C# Standard 2002 Edition. I have downloaded Framework 1.1. I have also downloaded several component libraries and tried to add them to my toolbar. In most ca...more >>

How to do this in C#?
Posted by KA Kueh at 6/10/2004 7:20:30 PM
Dear all, I have a WinForm in C# and has one button to popup another modal window for user to key in wild card search against a database? Once found the user would double click on the list and this would call a populate method on the original WinForm. I am confused as to how to implement thi...more >>

this keyword problem
Posted by Timothy V at 6/10/2004 6:20:16 PM
Hi everyone, I'm having trouble with the keyword this inside a class. The following code is an example of the problem, not what I am actually doing. public class C { public C() {} public string s; public void Function() { C c = new C(); this = c; } ...more >>

Schedule task when system shuts down?
Posted by Mullin Yu at 6/10/2004 4:37:32 PM
How can I do so? Can I write a windows service that will run a bat file when the system shuts down? I want to write a service because I can create a schedule task by Windows Scheduler only when the system starts up. Thanks! ...more >>

NULLs
Posted by Mike at 6/10/2004 4:37:00 PM
Hi. I have a database from which I am reading some integers into my C# app. The problem is some of these DB values are NULL, so obviously an error is thrown when I try to read them. Is there a standard way of representing a NULL value type? Anyone got any tips on this? Mike ...more >>



using delegates for multithreading
Posted by VM at 6/10/2004 4:24:20 PM
Hi, In my Win app, I'm using delegates because the process that'll be running is time-consuming and it requires parameters. The only problem I'm having is that the lines following the BeginInvoke (lines that depend on the outcome of the method) are being executed while the lengthy process is bei...more >>

What are the "accepted literal types"?
Posted by Pascual ataeda at 6/10/2004 4:05:31 PM
Hello, According to the MSDN documentation, FieldInfo.GetValue throws a NotSupportedException if “A field is marked literal, but the field does not have one of the accepted literal types”. What are the accepted literal types? What are the unaccepted literal types? *** Sent via Devd...more >>

need to allow unsafe code, but don't have a build properties page
Posted by lester at 6/10/2004 3:56:01 PM
I'm using a C++ dll and need to allow unsafe code because the dll function takes char *. I am using Visual Studio.NET 2002. Everything I've seen says to go to the project properties page, then the build properties page and allow it there. For some reason, my project does not have a build properti...more >>

Custom Wizard Engine problem (C#)
Posted by Mr. Mountain at 6/10/2004 3:55:34 PM
Hi, I am building a custom wizard engine in C# following the example in "Mastering Visual Studio.NET" by Griffiths, Flanders and Sells (pg 304). Unfortunately, I'm having several problems that the book isn't helping me overcome. (It is a good book, but O'Reilly hasn't made code available and so ...more >>

I need to allow unsafe code, but have no option to do so...
Posted by lester at 6/10/2004 3:52:01 PM
I'm using a C++ dll and need to allow unsafe code because the dll function takes char *. I am using Visual Studio.NET 2002. Everything I've seen says to go to the project properties page, then the build properties page and allow it there. For some reason, my project does not have a build properti...more >>

C# language specs bug with section 7.11.2 ?
Posted by GP at 6/10/2004 3:50:21 PM
It appears to be a flaw in the specs, or I did not understand how it works. 7.11.2 User-defined conditional logical operators says that in order to overload conditional logical operators && and || (which cannot be directly overloaded in C#) you need to overload the true and false operators and ...more >>

Urgent problem: Any help greatly appreciated
Posted by Simon Harvey at 6/10/2004 3:49:47 PM
Hi everyone, I'm having a problem that I don't know how to sort. I am trying to execute a number of SQL stored procedures in a single transaction. However it always throughs an exception saying that the "Thread was being aborted" I really need to be able to execute these procedures in a sin...more >>

Reading Remote Files
Posted by Michael C at 6/10/2004 3:46:49 PM
Hi all, I'm trying to get a full directory listing from a remote machine. Anyone know how? Also, is it possible to read a file from a remote machine, like a ..TXT file or a .XML file in a specified directory without using the C$, D$, etc. or other shares? Finally, what rights would I need t...more >>

Real life cost of using exceptions for control flow?
Posted by miyra70 NO[at]SPAM yahoo.com at 6/10/2004 3:29:03 PM
Hi. I'm working with an app that uses exceptions for control flow. These are code blocks where exceptions are thrown/caught regularly. A couple hundred exceptions occur per hour and they're caught close to the point of origination. I'm trying to decide whether to refactor... What is the cos...more >>

drawString in growing/shrinking rectangle
Posted by Tim Bücker at 6/10/2004 3:14:34 PM
Hello. The MeasureString method is quite slow so I am wondering how one can efficently draw a string in a growing or shrinking rectangle. In other words; having a huge rectangle the font size should be for example 100; having a small rectangle the font size should be 8. Any ideas? Thanks a...more >>

French charactor
Posted by Yongjian at 6/10/2004 3:09:01 PM
Hello, I want to read a text file which contains French charactor, then modify some of the sentence, save it as a new text file. But I found the new text file lost all the French charactors. Anybody can help me? Thanks, Yongjian My code: StreamReader sr = new StreamReader(stSource,En...more >>

Improving performances reading a XML into a DataSet
Posted by Dev at 6/10/2004 2:55:24 PM
Good Morning to all, I have a bunch of XML files that need to be readed inside the same DataSet (each XML represent a single table). In the event of a large (some megabytes) file, what is the best practice to read them into the DataSet via the ReadXML() method? Thanks, sorry for my newbie...more >>

How to start Outlook express with subject?
Posted by david at 6/10/2004 2:52:53 PM
I have an windows .NET application. I want to click a button to start outlook express to send email. Not only start Outlook express, but also pass information to fill int the subject and content field. Thanks a lot. David ...more >>

Can I get a instance from type?
Posted by ºù«µºÉÌÇæÈí¼þ£­ÕÅн¨ at 6/10/2004 2:38:21 PM
i konw a type(no class),can i get this type`s instance list? ...more >>

Making a form resizable with FormBorderStyle = None?
Posted by harrylmh at 6/10/2004 2:24:46 PM
Hi, I've really been struggling with this. How do I make a form resizable with FormBorderStyle = None? I've had problems trying to get the form to start resizing by following the mouse position(after the mouse is at the edge of the form and starts to move out of the form with the mouse button d...more >>

[simple?] convert an unsigned long to byte array and vice versa
Posted by War Eagle at 6/10/2004 1:18:01 PM
Is it possible to convert an unsigned long to byte array. For instance, unsigned long = 23480923 unsigned long longNumber; longNumber=23480923; // in binary = 1 0110 0110 0100 1010 0101 1011 // so i want byteArray[0]=0000 0001 , byteArray[1]=0110 0110 , // byteArray[2]=0100 1010, byteArray[...more >>

row changing event
Posted by claire at 6/10/2004 1:17:43 PM
Hi, I have a windows form c# project using a typed dataset. When a row is changed i need to update the revision column of the dataset, before calling the dataadapter.Update to update the database. I thought maybe i could use the row changing event of the dataset to add one to the revision col...more >>

Hashtable in a Hashtable in C#
Posted by skrishnan NO[at]SPAM snet.net at 6/10/2004 1:08:31 PM
I would like to have the value entry in the Hashtable to be a Hashtable itself and the value data in the second hashtable to be an ArrayList. I would like to store the following type of data date : time : open high low close ... .... I have intra day stock data. I would like to qu...more >>

Collection order
Posted by Mike at 6/10/2004 1:08:27 PM
If I create a collection and add members using the Add() method, is is guarenteed that the members will be returned in the same order that they were added, if: i) I enumerate using a foreach loop? ii) I index from 0 to Count-1 using a for loop? Cheers, Mike ...more >>

GetResponseStream returns Junk characters
Posted by SKG at 6/10/2004 12:52:59 PM
Iam trying to read an xml file from a website and i get junk characters. But when i open the same file in browser everything is fine. here is the snippet of the code WebRequest objRequest = WebRequest.Create("http://www.xvdabc.com/order.xml"); WebResponse objResponse = objRequest.GetResponse...more >>

Editor Question
Posted by Wayne A. via .NET 247 at 6/10/2004 12:46:05 PM
Hi All, I wonder that why MS SQL query analyzer doesn't have similar= feature like the one in VS=2ENET studio, for example: when you key= in a table name, bring up all columns of this table to be choose= from=2E Can I do it with C#? what should be used to bring up those= list, context men...more >>

stay on top form
Posted by carmen at 6/10/2004 12:45:16 PM
I need to show a litte advertisment window that remains on top until something happens. I'm trying to use .Show or ShowDialog but these windows go to back when I click any area of the back main window. I need some advice, please Carmen ...more >>

With operator
Posted by David at 6/10/2004 12:34:42 PM
What is the analog of With operator from VB.NET in C#? ...more >>

Retrieve Data from a stored procedure with multiple select statement
Posted by gh at 6/10/2004 12:30:04 PM
I have made the following stored procedure with the following select statement select * from user select * from order, orderdetail where order.id=orderdetail.id I know I can uses DataReader class to get data from the store procedue. However, is there any way for me to use DataAdapter to get...more >>

Important refs question
Posted by Simon Harvey at 6/10/2004 12:20:24 PM
Hi all, When executing the following, is it a copy or a reference thats copied to the array? SqlCommand cmd = new SqlCommand("w", x); myArrayList.Add(cmd); // A reference or a copy? The reason i ask is that I then want to go on and use the same va...more >>

serialization bug
Posted by Aaron Clamage at 6/10/2004 11:56:00 AM
Hi, Could someone please confirm the following? I think I have found a subtle .NET serialization bug. It occurs when object has a list of items containing another object of the same type and both objects have a non-static member reference to some other static object. In this case, I get a...more >>

GetStream().Read problem
Posted by Mike at 6/10/2004 11:55:13 AM
Hi, I have an iteration to retrieve a number of messages from a server. = Within this iteration, I am using the following code: do { readBytes =3D base.GetStream().Read(received, 0, received.Length); string textToAdd =3D Encoding.ASCII.GetString(received, 0, = readBytes);...more >>

Windows Service & Timer event
Posted by caulker at 6/10/2004 11:53:55 AM
I have a windows service with a Timer which runs just fine on my Development machine, but the "timer_elapsed" is not being executed on the Production machine. same .exe on both machines. i'm writing events to the event log, so i know the dev machine is fine, but not the production machine. w...more >>

Need Your Advice on "DrawString on Panel with AutoScroll"
Posted by johnwelch1024 NO[at]SPAM hotmail.com at 6/10/2004 11:16:53 AM
I'm trying to use the DrawText() method to draw some very long string text on the Panel with AutoScroll enabled. However, for some unknown reasons, I could not trigger the ScrollBar to show up. Here is the simplicied section of drawing code: private void panel_Paint(object sender, System.Wi...more >>

Installer question
Posted by No One at 6/10/2004 11:05:09 AM
Does anyone know if a .Net installer app can be programmed to pick up any extra files that are not in the C# project and install them at runtime? Let's say I have a few images that are a part of the C# project. The installer project picks them up fine. Now say a user runs the installer and th...more >>

Best way to send byte[] parameter to unmanaged code?
Posted by Philippe Bertrand at 6/10/2004 11:01:59 AM
Using C#, I want to send a byte array to an unmanaged function with the minimum amount of copies. The array is input only and won't be modified (its copied on the unmanaged side). I'm currently using fixed byte *. My question is: Should I be using In byte[] parameter instead? Ref parameter?...more >>

instantiating an object from string value
Posted by Jason at 6/10/2004 10:56:08 AM
Hi all I would like to instantiate an object from a string value. if, for example, i have a "Accounts.Account" class, how would i use that string to create that object? normally you would have Accounts.Account accObj = new Accounts.Account(); i would like to accomplish the same as the ab...more >>

do you have to always instantiate variables in C#?
Posted by TS at 6/10/2004 10:47:59 AM
I am coming from vb.net. I have seen that most variables need to be instantiated before using in c#, unlike vb.net. When you declare a variable and immediately set it's value, does that instantiate it? Since I never call the constructor (new xxx), I don't know that it does. Ex: int myInt = 5; ...more >>

Changing data in datagrid
Posted by Gidi at 6/10/2004 10:26:01 AM
hello, i'm writing a windows application in C#. i have a dataGrid that takes data from dataset that connected to sql stored procedure, and i have few radio buttons. i want that when ever the selected radio button chaged the data in the the datagrid will change also. i replaced the dataMemeber an...more >>

Compilation error in C#/ASP.NET app - CS1519: Invalid token 'using' in class, struct, or interface member declaration
Posted by Erik H. at 6/10/2004 10:20:33 AM
I have an ASPX page in which I am trying to bind a datagrid to a dataset pulled from Microsoft Access DB using code inline method. For some reason, the compiler is having a problem with 'using'. Any help here would be much appreciated. Thanks! Getting the following error: CS1519: Invalid toke...more >>

DataSet load a XML string in the memory
Posted by foolmelon NO[at]SPAM hotmail.com at 6/10/2004 10:14:45 AM
If I have a XML file, I can use ReadXml to load the file into DataSet. But if I have the whole XML string in memory, how to load this string into a new DataSet? Bill...more >>

Simple Threading question
Posted by skrishnan NO[at]SPAM snet.net at 6/10/2004 9:54:30 AM
One thing that has confused me is If I have a thread that is reading a file and would like to transfer the data to listbox which is the main application What needs to be done to transfer data from threaded space to main .. thanks...more >>

RadioButtonList
Posted by Michelle C at 6/10/2004 9:54:27 AM
Hello I am new to this please forgive me if I dont explain this right but here goes, I hope you can help. I am building a site and on one of the pages I have Radiobutton List page. I am useing Visual Studio C# and I want to put the text for the buttons under them instead of on either side.. ...more >>

Messenger Service
Posted by UhihaJax at 6/10/2004 9:38:01 AM
I have been asked to make a very simple messenger application to run on a local intranet. Having not designed anything like this before my first thought is to work out the trigger for the recieving of messages. All I can think of at present is sending a file to location on the hardDrive and gettin...more >>

Select Statement
Posted by kscdavefl at 6/10/2004 9:26:05 AM
I am using the following select statement in a web app where I take the cvalue in a text box and conduct a search of the database. "Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'"; I want to search the text box to see if it contains % and if it does I want to use like ...more >>

How to replace a pattern in a html file using C#?
Posted by Sam Kon via .NET 247 at 6/10/2004 8:41:58 AM
Can any one of you let me know, how can I replace a pattern in an html file using C#? I have the contents of the html file stored in a string. I just need to replace some of the elements which have a similar pattern? ex: I have a field {Token = LoanNumber} in the html file. I just need to replace...more >>

How to get a simple user entry in a dialog box ?
Posted by Gilles Lambert at 6/10/2004 8:26:39 AM
Hi, I come from VB .NET where the InputBox function is ad hoc. Does any one knows if C# allows something like it ? Thanks and best regards Gilles *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

Datagrid images problem
Posted by sqlprob NO[at]SPAM yahoo.fr at 6/10/2004 7:39:06 AM
I am building a website using C#, asp.net and SqlServer. I need to store a lot of images in my database. I need to store thumbnails but also larger pictures(when user clicks thumbnails a larger picture is displayed). For doing that I was told to store only the URL's. My problem now is how to dis...more >>

Help - Any control that has same functionality as IE to display XML???
Posted by leeedw NO[at]SPAM hotmail.com at 6/10/2004 7:14:20 AM
Hi, Is there any control (free) that has same functionality as IE to display the XML document without having to create a physical file? if using Webbrowser control (ActiveX control) I have to create a xml file and then use .Navigate(url) ... Thanks!...more >>

Automatically copying a file to compile directory?
Posted by Jacob at 6/10/2004 7:10:35 AM
Really more of a VS.NET question than a C# question.... I have a couple files in my solution that I would like copied to the compile directory when the solution is built. How do I set it up so that everytime I build the solution these files will automatically be copied into the same directory? ...more >>

MenuItem needs a Custom Shortcut
Posted by deja NO[at]SPAM homerlex.mailshell.com at 6/10/2004 7:10:32 AM
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I can tell there is no way to add a short cut that is not in the Shortcut enum. I have my on keyboar...more >>

Asycnch file reading ?
Posted by sjoshi NO[at]SPAM ingr.com at 6/10/2004 7:01:00 AM
All I'm trying to use the asynchronous method of reading a big file and outputting it but somehow it prints out the whole file before running the main routine. Here's the code. using System; using System.IO; using System.Threading; using System.Text; class AsynchFile { private File...more >>

ASM/HLA
Posted by 2G at 6/10/2004 5:22:04 AM
Helloo, I'm planning on learning some asm since it has always interrested me (I know nothing of it yet, only .net and a little c++) and noticed that there are some differences in asm (MASM,TASM,HLA) so I'm a bit confused on where to start. My first impression is to go with the HLA since I hav...more >>

DataGrid Cells
Posted by Gidi at 6/10/2004 4:55:01 AM
hello, i have an empty dataGrid which i want to insert different input for each cell. and i want to use the keyPress\Up\Down event. as iundestand after trying almost everything i know, is that when the cell has the focus on it, the dataGrid events don't effect it. so how can i write the cells to...more >>

Swing vs. WinForms
Posted by frank-ulbricht NO[at]SPAM gmx-dot-de.no-spam.invalid at 6/10/2004 3:22:25 AM
Hi folks, I'm a Java programmer and now I have to use C# for a new large project. The language is the best I've ever seen. In some points it goes far beyond Java. I like that. But then there was a great dissappointments about WinForms. Compared with Java/Swing (skip the performance, I mean ...more >>

VB6 to C# and VB.NET to C# convertors
Posted by BuddyWork at 6/10/2004 2:04:50 AM
Does anyone know of any good VB6 to C# and VB.Net to C# convertors? Thanks for your help,...more >>

Newbie Namespace Question
Posted by Yaiz at 6/10/2004 1:41:01 AM
Hi, The following code snippet doesn’t compile with, helloworld.cs(25,39): error CS0246: The type or namespace name 'Library' could not be found (are you missing a using directive or an assembly reference?) Why can’t the “Library” namespace be found when its location “Company.Appl...more >>

DataGrid: Setting the first visible row
Posted by TT (Tom Tempelaere) at 6/10/2004 1:29:01 AM
Hi people, How can I set the first visible row by index in a DataGrid? Thanks -- Tom T....more >>

DataGrid: Setting the first visible row
Posted by TT (Tom Tempelaere) at 6/10/2004 1:27:01 AM
Hi people, How can I set a certain row as the first visible row in a DataGrid? Thanks, Tom T....more >>

Question found elsewhere
Posted by DigitalSpectre at 6/10/2004 1:25:01 AM
Lee Wrote : Do you know if/how you can open a file say a txt or doc from a asp.net page that opens the file say a word document in word but not word within the IE browser. word as a application and will allow you to save any changes. this is for running over a intranet so if you click on the doc f...more >>


DevelopmentNow Blog