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# > october 2003 > threads for thursday october 30

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

Newvie - String to Int conversion
Posted by Stig Nordlander at 10/30/2003 10:45:17 PM
I'd like to enter a numeric value in a textbox and use the value in a calculation but I can't get it to work int X X = textBox1; I get the error message Cannot implicity convert type 'System.Windows.Forms.TextBox' to 'int' What must I do to make it work? ...more >>


Hidden File
Posted by Dean at 10/30/2003 10:20:31 PM
How do you create and read from a hidden file in c#? ...more >>

C# Standalone??
Posted by Kailey Joanette at 10/30/2003 10:20:17 PM
Hey guy, Relatively experienced programmer here (4th year university), playing more or less for the first time with .NET and C#. I'm wondering what the quickest, most efficient, and smallest way is of putting together a program written in C# so that it will run on a machine without th...more >>

How do I make one Form parent of Another.
Posted by Devicharan at 10/30/2003 10:16:56 PM
I have two forms, a Main Form and a Child Form. And In the Main Form, I have a small Async Process, Which needs to show the child form. I use mainForm.BeginInvoke(ShowtheNewForm) to start the async process and in the funciton (ShowtheNewFOrm) I say ChildForm.Show(). I cannot use Sh...more >>

Trial Version
Posted by Dean at 10/30/2003 9:43:30 PM
I have a program I want people to be able to try (limit 15 uses) before they buy. How can I make my program terminate if no serial number is present the 16th time it is run. I have thought of using files, but they are easily spoofed. I want to make sure it still works if the software is...more >>

problem with GDI+
Posted by dawn at 10/30/2003 9:39:11 PM
Hi, With the code I use to capture part of a form, an error shows up : External GDI+ error the code is the following private void button3_Click(object sender, System.EventArgs e) { resdial.Activate() ; System.IntPtr srcDC=GetDC(resdial.axWebBrowser1.Handle); Bitmap bm=new Bitmap(...more >>

wsdl generation from c#
Posted by Mullin Yu at 10/30/2003 8:48:38 PM
i just know that i can write the struct at c#, and then asp.net will automatically generate the wsdl, but there're some limitations e.g. can't write the soap header, can't show all the structures of wsdl, can't set the occurance of the element, can't create attribute is there any better way to...more >>

FTP Client "put" command
Posted by Jacques Cooper at 10/30/2003 8:36:10 PM
Hello, We are looking for some C# .NET source code (preferably free, but we will pay for the source code) that implements an FTP "put:" command (uploading a file). We found a couple of C# sample programs that perform an FTP "get" command (downloading), but none of the samples had an FTP "pu...more >>



Beginners question
Posted by Andy Hoe at 10/30/2003 7:57:10 PM
Hello, I'm new to C# and I am having a small problem. All I want to do is take a sentence from the user then replace certain words with other ones. So I started off with this: string myString = Console.ReadLine(); string editString; editString = myString.Replace("is", "isn't"); Console.Write...more >>

Thread.Sleep...
Posted by news.microsoft.com at 10/30/2003 7:16:43 PM
Hi, Currently I have a thread thats spinning and doing a Thread.Sleep(someTime). I was thinking of changing this to Thread.Sleep(Timeout.Infinite); then when I have actual data in a collection to process in this thread, I was going to do a _thread.Interrupt(); Would this be a better a...more >>

Launching IE from my windows form
Posted by Muscha at 10/30/2003 6:39:31 PM
Hello, How do I launch an IE instance with the URL as the parameter from my windows form? I have the axWebBrowser control, should I use that one? Thanks, /m ...more >>

creating a dataset from XmlNode
Posted by tim djossou at 10/30/2003 6:33:19 PM
Hi Is there a simple way to create a dataset from a XmlNode ? or from a string containing the XML? Regards ...more >>

refreshing databinded values
Posted by Dmitry Karneyev at 10/30/2003 6:07:54 PM
Hi! How to force refreshing databinded controls of the win form? ...more >>

How to pass special characters in Update stmt!!
Posted by Jay at 10/30/2003 5:28:01 PM
Hello, I need to use Update Sql stmt from my page. Some of the field values has apostrophes and and quotes. How do I make ado.net ignore those characters? Eg- UPDATE ROOM SET HEIGHT='3' - 5"' WHERE RMNU='100' Iam using c#. Thanks. Jay ...more >>

String to byte array
Posted by Dan C at 10/30/2003 5:18:56 PM
Is there a routine in c# that will transform a string ie"Hello Mom" into a Byte[] array. I have found char[] cTmp = pString.ToCharArray(); But I have not been able to figure out how to convert a char into a hex value and place that value into the byte[]. Thanks for your help Dan C ...more >>

Arrays and pointers
Posted by Fernando Cacciola at 10/30/2003 5:10:55 PM
For fast image procesign code I need pointers to the elements of a two dimensional array: mData = new int[mH,mW]; mScan0 = &mData[0,0]; however, the above won't compile since AFAICT fixed blocks require "local" pointers: fixed ( int* lScan0 = &mData[0,0] ) { // this works } while...more >>

Generate TYPE on-the-fly
Posted by Zoltan Hernyak at 10/30/2003 4:52:17 PM
Hi, Can I generate a new type (a class with fields only) on-the-fly, from a running app, and use it right then? For example if I want to build a class which consists of fields which are parameters of a method. I want to write a method which gives a method 'name' as a parameter, and construc...more >>

Critical Section?
Posted by Ed S at 10/30/2003 4:36:03 PM
HiAll, What would you suggest I use if I want to protect the creation of a singleton - in the instance() static method. In C++, I'd use a critical section. Thanks, --Ed ...more >>

Storing a reference to a string
Posted by Matt Burland at 10/30/2003 4:34:35 PM
I was wondering what the correct way to do this is, in C++ I'd just use a string* : public class A { private string myString // I actually want to keep a reference, but I'm not sure of the syntax ..... public A(ref string aString) { // This method has a reference to aString - Any ...more >>

c# windows service on windows 2003 server
Posted by cs at 10/30/2003 4:23:19 PM
I have a windows service that interacts with teh desktop, yes I know the consequences, anyways, the service works fine on winxp but when I move it to windows 2003 server the service doesnt interact with the desktop anymore, I even have clicked the little thing that says that its ok to interact wi...more >>

Re-designing tabcontrol
Posted by Fatih BOY at 10/30/2003 4:18:11 PM
Hi, Does anyone knows how to handle painting of Tabcontrol??! I've override OnPaint and WndProc ( with m.Msg==WM_NCPAINT) functions, but doesn't work! Thanks, Fatih BOY ...more >>

oops another problem
Posted by dawn at 10/30/2003 4:17:29 PM
Hi, With the code I use to capture part of a form, an error shows up : External GDI+ error the code is the following private void button3_Click(object sender, System.EventArgs e) { resdial.Activate() ; System.IntPtr srcDC=GetDC(resdial.axWebBrowser1.Handle); Bitmap bm=new Bitmap(...more >>

handle for axWebBrowser1 in Form2
Posted by dawn at 10/30/2003 3:53:28 PM
Hi, I'm trying to capture part of Form2 into a bitmap when I click on a button on the main form (form1). After advice I'm using the following code : System.IntPtr srcDC=GetDC(Form2.axWebBrowser1.Handle); Bitmap bm=new Bitmap(50,50); Graphics g=Graphics.FromImage(bm); System.I...more >>

Findong number of Com ports on a machine
Posted by rollasoc at 10/30/2003 3:31:49 PM
Hi, Anyone know a way of working out the total number and which COM ports exist on a machine, using C#? rollasoc ...more >>

does the next version of C# (.Net Framework 2.0) have equilvlant "My" class as in VB.Net
Posted by babylon at 10/30/2003 3:00:39 PM
e.g. in VB.Net NOW Const GreetingName As String = "Greeting" Dim sDisplay As Object Dim ResMgr As ResourceManager ResMgr = New ResourceManager("ResourcesSample.MyStrings",_ Me.GetType.Assembly) sDisplay = ResMgr.GetString(GreetingName) VB.Net in .Net Framework 2.0 sDisplay = My.Res...more >>

File IO Question
Posted by Jack at 10/30/2003 2:52:23 PM
I am trying to read an old text file with blanks. I am wondering how do I loop through each line even if its a blank? I cannot use the code below to loop through the file. Also,some of these text files are delimited by a space and not always delimited with carriage return. How can I make the ...more >>

Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset
Posted by Nedu N at 10/30/2003 2:36:12 PM
Hi All, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data into typed dataset in order to ease the further processing using typed references. DataSet ds = getDataFromDB(); - i am getting the dataset ds f...more >>

String concanation bug??
Posted by casper NO[at]SPAM jbr.dk at 10/30/2003 1:57:24 PM
I am seeing some really strange behavior in what should be basic language constucts. Sometimes, when forming a new string (a) by concanating other strings (b + c), only the first substring (b) gets into this new string (a). More specifically, I am concanating elements I extract from the Array...more >>

Synchronized dataset
Posted by Zürcher See at 10/30/2003 1:54:10 PM
I have in a form a datagrid that display a dataset, but if I start a new thread that fill the dataset the program will crash, that's because the dataset is not synchronized, is not thread safe. I tryed to use the monitor.enter(dataset) and monitor.exit(dataset) befor updating the dataset but was...more >>

Collections and implicit cast
Posted by Bratislav Jevtic at 10/30/2003 1:44:11 PM
hi, Let's suppose I've got 2 classes: MyClass and MyClassColl (coll is inherited from ArrayList, for instance). But, when I invoke GetXXX or something returning object, I receive an object - not instance of MyClass. I've tried with implicit conversions - not working. Is there any way to inh...more >>

C# and VB.NET comparison
Posted by Frank McCown at 10/30/2003 1:38:15 PM
I've created a quick reference comparison of C# and VB.NET that you might find useful. I couldn't find anything like it on the web and so I made my own. http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_compa rison.html It doesn't cover every area of the languages, just those featur...more >>

Debug a console program with arguments?
Posted by Gustaf Liljegren at 10/30/2003 12:52:01 PM
I have a console program that takes one file and outputs another. The file name is submitted as an argument as usual. I can't figure out how to have the nice step-by-step debugging while also submitting arguments on the command-line. That is, first run the program as the end user, submit the arg...more >>

exporting functions from a c# dll
Posted by Joshua Emele at 10/30/2003 12:44:54 PM
Hello - I am new to c# having come from the land of c. With c, I could create a .def file: library cdll exports foo @1 bar @2 and the linker would magically make available these functions at the specified ordinals: Dump of file cdll.dll File Type: DLL Sectio...more >>

C# SQL Server
Posted by Priya Ghate at 10/30/2003 12:33:52 PM
Hi, I want to create a web application using C# and SQL Sever. Any pointers where to start from ? Help would be highly appreciated. Thanks, Priya ...more >>

Get week dates
Posted by MFRASER at 10/30/2003 12:19:33 PM
If I have a date how can I find out the beginning of the week and the end of the week? System.DateTime StartDate = new DateTime(2003,10,29); System.DateTime StartWeek = ? System.DateTime EndWeek = ? ...more >>

keyword with in C#
Posted by Elder Santos at 10/30/2003 12:15:07 PM
hi, everyone, i would like know why c# doesn't have the keyword "with", such as vb does? Thank u so much;; --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003 ...more >>

Values in Form
Posted by Marcus Vinícius at 10/30/2003 11:44:51 AM
Good morning I have a form in c# (windows form) where the user select the his state. This string was put in a public field and a property check it (GET/SET). When the user click in OK button in this form, i have a string strEst with his value (state). This search for is called to principal for...more >>

IComparable vs IComparer ?
Posted by Cybertof at 10/30/2003 11:06:27 AM
Hello, Could someone please explain me the difference between the 2 interfaces IComparable and IComparer ? In which cases use one or the other ? Are they dedicated to own classes or built-in collections ? Regards, Cybertof. ...more >>

how to remove all non-digit characters from a string
Posted by Zeng at 10/30/2003 10:54:11 AM
Hello, Is there a way to remove all non-digit characters from a string in one call? string.Replace() methods don't allow this. thanks! ...more >>

Regex question
Posted by Hardy Wang at 10/30/2003 10:40:58 AM
Hi: How to write a pattern to find strings which do not contain some certain string? For example, I need to search all strings without "abc" in them. Thanks! -- WWW: http://hardywang.1accesshost.com ICQ: 3359839 yours Hardy ...more >>

Double.ToString()
Posted by Ahjay Muscha at 10/30/2003 10:28:01 AM
What's the best way to convert from a double to a string? for example, at the moment I have to do this: string s = new Double(a + b / c).ToString(); Is there a better way for me to do this so I don't have to create a double object all the time? thanks, /m ...more >>

Changing location of Emit built types when running as a Windows service
Posted by Urs Vogel at 10/30/2003 10:27:34 AM
Hi When building and saving types using the Emit namespace from a Windows service, the AssemblyBuilder.Save methods puts these assemblies into the System32 directory, altough the startup path points is where the Service is located. The AssemblyBuilder.Save method does not allow to set the dir...more >>

Object.GetHashCode()
Posted by Guinness Mann at 10/30/2003 10:11:46 AM
resource.cs(8,15): warning CS0659: 'UA.LMS.Resource.Resource' overrides Object.Equals(object o) but does not override Object.GetHashCode() What does this mean? I mean I know what it says, but do I need to do anything? If I specify exactly how to do the comparison why would I need to provi...more >>

HasElementType
Posted by William Stacey at 10/30/2003 10:08:37 AM
Type.HasElementType - "Gets a value indicating whether the current Type encompasses or refers to another type; that is, whether the current Type is an array, a pointer, or is passed by reference." So why does this return false? String is passed by ref and is a ref type. string s = "text";...more >>

Any advantage of EventArg as class or struct?
Posted by Dan H. at 10/30/2003 10:06:16 AM
Hello, Is there any advantage of using a struct or a class as part of public delegate bool MyEvent(object source, SomeEventArgs e); Struct: public struct SomeEventArgs { public float SomeFloat1; public float SomeFloat2; } Class public class SomeEventArgs { public void Som...more >>

how to capture part of form in a bitmap
Posted by dawn at 10/30/2003 10:05:22 AM
Hi, I'm trying to capture a part of an active form into a bitmap. So the coordinates for the part that needs to be captured should be relative to the window, because the window might move on the desktop. Secondly I'd like to compare this to an image I have already stored on my computer. Is t...more >>

Unicode In C#?
Posted by Mark Relly at 10/30/2003 9:57:49 AM
Hello, I was wondering if anybody knew much about Unicode strings in C#. I have a Unicode encoded string but how can I see the contents of this string so it doesn't display "???????????"? I don't want to trans form it back into a ASCII string using Encoding.ASCII before I view the data i...more >>

Converting String to DateTime not working
Posted by coreo_berty NO[at]SPAM hotmail.com at 10/30/2003 9:23:26 AM
I accept a date from a user in a textbox, but I need to convert it to a DateTime. I have the following code: return DateTime.ParseExact("01/10/2003", "dd/MM/yyyy", new CultureInfo("en-GB")); When I run it on my development PC it's fine - I get 1st October 2003. When I run it from my webs...more >>

question about database relationships
Posted by Sean McKaharay at 10/30/2003 9:19:30 AM
I have 2 disconnected servers I need to take new data from server 1 to server 2. I am exporting the data from server1 to xml. My thought was going to import the xml into a dataset then do bulk insert and updates, but to do that I need to find out what order the tables need to be loaded so I don't...more >>

Post Load Event
Posted by James Lennon at 10/30/2003 9:16:45 AM
Is there an event that is raised that occurrs after a Windows form is displayed for the firt time? The Load event occurrs before the form is displayed for the first time I am looking for an event that is raised after the form is displayed for the first time?...more >>

midi API MIDIHDR String MarshalAs...
Posted by Tim at 10/30/2003 8:43:26 AM
I am having problems using interop to call midiOutLongMsg. in my MIDIHDR struct, i allocate MsgData as a string I have been using a StringBuilder object to build MsgData per byte. I am not getting the proper results, although sometimes I do hear some notes being played, just not the rig...more >>

ADO (TNS Error)
Posted by Dave Bailey at 10/30/2003 7:59:01 AM
I am connecting to an Oracle database using ADO on a Webpage. When I run the program i get the following error when it gets to the oleDbConnection.Open command: ORA-12541: TNS:no listener Does anyone know how to handle this error? Thanks, Dave...more >>

Reflection on Stored Procedure
Posted by Aragorn at 10/30/2003 7:32:05 AM
I want to load into a SqlCommand objet an existing stored procedure. I know that by using the Parameters collection I can add parameters, but how can I retrieve the parameters already defined from the SP? I would like by a reflection-like mechanisms be able to get the parameters declared i...more >>

how to insert text and bitmap on the Image using c#?
Posted by Senthil Kumar at 10/30/2003 7:23:02 AM
Hi all, I am opening an image from file or url. I want to insert text and bitmap images on that Image at desired location. Any suggestions please. -- Regards, M.K.Senthil Kumar, Nobel Software Systems Inc., www.nobel-systems.com ...more >>

ListBox/ListView selection
Posted by Liz at 10/30/2003 6:58:14 AM
I have used a ListView with several columns and lines to display an array ListView1.Items.Clear(); ListView1.Items.Add(aClients[1].Id); ListView1.Items.Add(aClients[2].Id); ListView1.Items[0].SubItems.Add(aClients[1].Surname); ListView1.Items[0].SubItems.Add(aClients[1].Forename); ListVi...more >>

Can I add aTreeView to a ListView?
Posted by amil at 10/30/2003 6:56:03 AM
Hi all, Can I add a TreeView control to a ListItem or SubListItem of a ListView just like the one you can see in a news thread? I'm trying to create a UI/display for a discussion application. ...more >>

C# Newbie Question
Posted by Siva at 10/30/2003 6:11:18 AM
Hi: I have a basic question: For example, consider the following statement in C#: using System.IO; The above statement gets the metadata for types defined in the IO namespace. By default, C# compiler only looks into mscorlib.dll. Does that mscorlib.dll have the reference to IO.dll i...more >>

GetType()
Posted by ron at 10/30/2003 5:57:14 AM
Hi, I am currently using the base class GetType() in the following way and was woundering if there was a different way of looking at types and doing a comparison for equality. Thanks Ron foreach(System.Web.UI.Control ctl in this.Controls) { if(ctl.GetType().ToString() == "System.W...more >>

port scanner
Posted by Jonny at 10/30/2003 5:36:56 AM
My scanner will be used to identify what services are running on a particular system on a closed network. Just wondering if there are any specific ports that i should watch/scan. thanks, /Jonny...more >>

Windows Service, I/O problems?!
Posted by Anders at 10/30/2003 4:47:59 AM
Hi all, I have an console app that looks in one folder (e.g. c:\temp) and copies all files to a couple of other folders, one local folder (e.g. d:\temp) and one mounted folder (e.g. x:\). All this works fine, but....when I run this application as a Windows Service the System.IO.File.Copy...more >>

ListView
Posted by Liz at 10/30/2003 4:19:57 AM
How do I add columns ACROSS and lines down from an array to a ListView. ListView1.Update(); ListView1.Items.Clear(); ListView1.Items.Add(aClients[1].Surname); ListView1.Items.Add(aClients[1].Forename); **starts new line...more >>

Help with security exception error!
Posted by Mech at 10/30/2003 1:52:55 AM
I am trying to connect to a simple Access Database on my c drive. I am using Windows 2000 pro; nothing special. the following code produces a security exception error. Why? string ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "DataSource=c:\\nwind.mdb"; Conn = new OleDbConnection(ConnS...more >>

How to process arrow keys?
Posted by bj at 10/30/2003 12:12:00 AM
How to process arrow keys? Hello I need to catch arrow keys down event from control derivied from usercontrol -OnKeyDown method seems to work for all keys besides arrow keys -however OnKeyUp method works just fine for them - OnKeyDown works when i press arrowkeys + modifiers keys like CTR...more >>


DevelopmentNow Blog