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# > november 2006 > threads for wednesday november 29

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

Save Rtf from a RichTextBox into Access
Posted by Fab at 11/29/2006 10:04:58 PM
Hi, How can I save the text edited in a richTextBox into a field of an Access table. I have an error using the following code: OleDbCommand toto = new OleDbCommand("UPDATE Table1 SET Field1 = '" + richTextBox1.Rtf.Replace("'","''").Trim() + "' WHERE id = 8" toto.ExecuteNonQuery. Field...more >>


Is this the correct way to send a Bitmap over sockets?
Posted by eliss.carmine NO[at]SPAM gmail.com at 11/29/2006 9:50:27 PM
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was doing something was really inefficient and could reduce 10 lines of code with 2, etc. For reading...more >>

how to set a shortcut key on a menu item
Posted by Wilfried Mestdagh at 11/29/2006 9:48:36 PM
Hi, This gives me a runtime error that it is an invalid value. I tryed some other keys with same result. However I tryed some function keys and they work (whell I did not test if it work, I did test if there was no exception). Are there limitations or do I do something wrong here ? cance...more >>

Maximising a borderless form
Posted by SeanR at 11/29/2006 9:34:20 PM
Hi, I wasn't happy with the customisability of the standard Windows form, so I decided to implement my own. Basically what I did was extend a borderless form and add my own borders and caption bar to it so it looks and functions like a normal bordered sizable form. However the only thing I ...more >>

Really simple regex problem
Posted by mikeachamberlain NO[at]SPAM gmail.com at 11/29/2006 9:07:50 PM
Hello there. This should be very simple for someone to solve. string s = System.Text.RegularExpressions.Regex.Replace( "King Henry Viii", "\bViii\b", "VIII"); Console.WriteLine(s); I think the above code should write out the string "King Henry VIII" (with capital I's), but instead it w...more >>

Easy question
Posted by Jake Forson at 11/29/2006 9:05:19 PM
Hi there, Is there a syntactically cleaner way to do this: if (!(MyObject is Whatever)) { // ... } Thanks. ...more >>

How force VS2005 to use older version of .NET Framework?
Posted by Ronald S. Cook at 11/29/2006 8:37:52 PM
I have been asked to write a ..NET Windows app using the 1.1 framework. I have both 1.1 and 2.0 on my PC. When I create a new project in Visual Studio 2005, it shows initial namespaces under references (System, System.Data) all of which are version 2.0. How can I tell my project to use on...more >>

MemoryStream instance length is 0 after stream has been written
Posted by Mikus Sleiners at 11/29/2006 8:00:06 PM
I'm trying to write new stream from string and i can't figure out why my memory stream instance is null after i have writen to it with stream writer. Here is an example. MemoryStream stream = new MemoryStream(); StreamWriter writer = new StreamWriter(); writer.Write ("my string"); at...more >>



.NET Grammar modification
Posted by Jon Slaughter at 11/29/2006 7:54:45 PM
I'm curious as to if .NET provides any direct means to modifying its own grammar? e.g., if say I want to had some "features" to C# which can easily be reinterpreted back into the original C# but I do not want to have to write a full blow parser just to change some simple thing. Lets suppose...more >>

Fastest way to convert an object to a string
Posted by Buddy Home at 11/29/2006 6:47:11 PM
Hello, I'm trying to speed up a piece of code that is causing performance issues with our product. The problem is we are using serialization to convert the object to a string, this is costing us performance degrade. Does anyone know any better way to archive this which just not degrade perf...more >>

XmlSerializer Hexadecimal question
Posted by INeedADip at 11/29/2006 4:43:23 PM
I have a webservice that returns data from a database. Our services (the clients) have been blowing up because of illegal character problems. Is there anything I can do on the server side to work around this problem. I'm OK with deleting all the "bad" characters. I have a couple DTOs that...more >>

c# oledb - multiple inserts to access (mdb) VERY slow - help!
Posted by dan at 11/29/2006 3:55:28 PM
within a loop i am building a sql insert statement to run against my (programatically created) mdb. it works but it seems unreasonably SLOW! Sorry, dont have the code here but the jist is very standard (I think!); e.g: # get connection loop { build sql (35 fields to insert) ca...more >>

System.IO.File.IsBinary() ?
Posted by Ympostor at 11/29/2006 3:13:07 PM
Hello. Is there a method in the .NET class libraries to know if a given file is binary or just plain text (ASCII)? Thanks in advance. -- ...more >>

programmatically export the event log
Posted by Lee Crabtree at 11/29/2006 2:51:46 PM
Is there some way to export an event log to a .evt file? I ask because what we're trying to set up is a really easy way for a user to email the contents of our event log back to us in the event of some problem. Emailing isn't a big deal, the SmtpClient class is a breeze, and working with th...more >>

ComboBoxes in DataGridViews bound to DataSources
Posted by jjsavage NO[at]SPAM gmail.com at 11/29/2006 2:47:51 PM
Hi all, I've got a DataGridView bound to a DataTable, and I need to make some of the columns into ComboBoxColumns. I've tried some of the solutions listed here, but I can't seem to make them work. They might not be the solutions I'm looking for; I just want to have a few arbitrary values...more >>

Add new record to database
Posted by Marko at 11/29/2006 2:20:44 PM
I am trying to add new record in database. There is no compile error but program is not adding any record to database. Hot to fix it? This is my code: OleDbDataAdapter odbAdapt; DataSet dsObject= new DataSet(); DataTable dtObject; string SQL; string ConnStr; int BrojSlogova; ConnStr =...more >>

Help with formatting
Posted by fatima.issawi NO[at]SPAM gmail.com at 11/29/2006 2:05:22 PM
Hello, I am creating a web page using c# and asp.net. I am trying to populate a list box by reading text from a file. The text in the file has leading spaces in order to show a hierarchy of the items. I would like this formatting to show up in the listbox, but it seems that strings are trim...more >>

<object>.Execute method in C#
Posted by ewingate NO[at]SPAM gmail.com at 11/29/2006 1:59:29 PM
While translating some VB code to C# (both .NET 2.0) I ran across the following line of code: sResult = m_oMaintain.Execute( sCommand ); sResult and sCommand are both strings and m_oMaintain is an object. The code is not compiling in C# because C#, it seems, does not have a definition for E...more >>

HOWTO?: enumerating custom attributes
Posted by davearkley NO[at]SPAM wildair.net at 11/29/2006 1:27:38 PM
I've recently 'discover' the wonders of custom attributes and reflection. There's one aspect that has stumping me and I've been unable to find samples in the docs or on the web. I have fields in a class which have zero, one or more custom attributes associated with each field. I'd like to get ...more >>

Thread Problem
Posted by JC at 11/29/2006 12:39:35 PM
Hi People, Please I need your help. This code run a thread ok but Not close later. thanks... private void RunServer(int aPortNumber) { _listener = new TcpListener(IPAddress.Any, aPortNumber); _listener.Start(); _ServerThread = new Thread...more >>

Throw question
Posted by Adrian at 11/29/2006 12:36:40 PM
If I code as follows try { \\ do something } catch (.....Exception) { throw; } What should happen? A test program isn't doing what I had expected it would do. Hence this question. Adrian. ...more >>

newbie question re namespaces
Posted by Laurel at 11/29/2006 11:20:16 AM
If I have "using System;" at the top of my code, why do I also need "using System.IO;" or "using System.Xml;" to reference attributes of System.IO and System.Xml? In other words, why can't I just use "using System," and then the following? (I get a compile error if I try). IO.StringReade...more >>

2nd try Sorting Algorithm.
Posted by AMP at 11/29/2006 11:00:26 AM
Hello, I posted this morning and recieved no responces., so I decided to simplify my question. How do I stop an exception from being thrown after the first run through of the while clause: private void InsertionSort_Function(uint[] IntCard,int length) { for (int j = 1; j...more >>

Differences with GDI+ when running under asp.net or nunit
Posted by grant.trevor NO[at]SPAM gmail.com at 11/29/2006 9:55:55 AM
I'm using the free pdf creation library pdfsharp(www.pdfsharp.com) to create a set of pdfs. This library makes heavy usage of System.Drawing and GDI+ I first implemented the pdf creation utility in a class that I than triggered via a simple NUnit test, a console application would have suffice...more >>

Indexers (I think!)
Posted by daz_oldham at 11/29/2006 9:20:38 AM
Hi everyone I am just trying to find how to implement Indexers... or at least that is what I think I want to implement! Very basically, in my database I have a table of T_Hotels which has many entries in T_Rooms. In my C#, I would like to be able to go: // Get a new instance of the Hot...more >>

C#, .NET and Shareware?
Posted by cbmeeks at 11/29/2006 9:02:13 AM
Sorry for the cross-post but I didn't know which group would be better.....anyway: I have a small app that I would like to release soon. It was written in C# and .NET 2 (using things like DataSets, etc). I've literally got less than a month into development and I'm almost done. I don't ...more >>

Difference between F5 et running directly the debug exe
Posted by Antoine P. at 11/29/2006 8:38:02 AM
Hello there - I've got the following problem: my C# app (an .exe using different dlls) has a different behaviour regarding the way I launch it. The right behaviour when I press F5 from Visual C# Express, and the wrong when I launch the exe file from the bin\debug directory. What's the differen...more >>

Problem Creating ListView Items - updated
Posted by garyusenet NO[at]SPAM myway.com at 11/29/2006 8:18:33 AM
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. Very simple. I would like to create listviewitem's for display in a listview control. The listview i...more >>

Algorithm question
Posted by AMP at 11/29/2006 7:47:56 AM
Hello, I just started working with Introduction to Algoriths from MIT Press and my goal is to rewrite them in c#. This is just a learning experiance. The following code: INSERTION-SORT(A) for j =E2=86=90 2 to length[A] // 1 Based Array { do key =E2=86=90 A[j] i =E2=86=90 j - 1 while...more >>

Seeking C# Engineer
Posted by hr3 NO[at]SPAM infdc.com at 11/29/2006 7:23:29 AM
Just joined this group and wanted some advice on how to get the word out about my companies job opening. We have done Monster and Dice and as you would expect, not much success in candidate quality. We are a Boston, MA based company working in the Banking/Financial world provided the latest in...more >>

What the book I should to choose about ASP.NET2.0 with C#.
Posted by Tong at 11/29/2006 6:34:11 AM
I would like to buy a book about ASP.NET2.0 with C#. I have chosen two book , - Professional ASP.NET 2.0 by Bill Evjen and - Pro ASP.NET 2.0 in C# 2005 by Matthew MacDonald I don't know what the book I should to choosed or have other book that better than this two books. Please tell me...more >>

c++ to c# help
Posted by scany14 NO[at]SPAM gmail.com at 11/29/2006 5:11:26 AM
Hi, I am trying to convert the following c++ code to c#. BYTE* pbmp = (BYTE*)malloc(lSize);; myFunction((long)pbmp); Can anyone help? Many thanks. ...more >>

ProgressBar incremented from outside of Form
Posted by mamin NO[at]SPAM o2.pl at 11/29/2006 3:59:36 AM
I have, the following question: I have a WindowsForm with ProgressBar progressBar1 and Button button1. After onClick event on button the following method executes: button_Click(object sender, EventArgs e) { DatabaseOperations.ClearDatabase(); } where ClearDatabase() is static met...more >>

Sending SOAP Messages Asynchronously
Posted by GR at 11/29/2006 3:55:57 AM
Hi, I've got a soap message as a string and would like to post it to a webservice (in C#) asynchronously: For example something like: string soap = "<soap:Envelope >...<MyMessageBody>....</soap:Envelope>"; I use the HttpWebRequest object to send off the message. But I think it does so sync...more >>

Dynamically resize form and add text?
Posted by garyusenet NO[at]SPAM myway.com at 11/29/2006 3:24:24 AM
Hi, I will outline what i'm trying to do here, and would really like to here your suggestions of how I can do it please. I have some code which finds the open internet explorer windows. I would like to display a form that allows the user to choose one of these windows. I have generated an a...more >>

for vs foreach for array enumeration
Posted by garyusenet NO[at]SPAM myway.com at 11/29/2006 1:52:55 AM
I'm a bit confused about the differences of these two commands (what is the right word for commands here?) when used to enumerate the contents of an array. The below example uses both foreach and for to enumerate the contents of the array. Also as well as explaining the differences could you ...more >>

Combobox Value Properties
Posted by NowSeeSharp at 11/29/2006 1:47:17 AM
Hi How do I get/set the value property of the combobox??? (similar to value field in the html below <OPTION value=1>Blah</OPTION> <OPTION value=2>Foo</OPTION>) Combo.Items.Add ... ? What kind of object have I to use ? Thanx ...more >>

Static function
Posted by csharpula csharp at 11/29/2006 1:13:33 AM
Hello, I am parsing some main arguments and calling to functions according to it. Is it possible not to define the called functions as static? How can I design it better? Thanks *** Sent via Developersdex http://www.developersdex.com ***...more >>

Left and right value of assignment for functions returning reference types
Posted by muler at 11/29/2006 12:55:58 AM
Hi all, This is an excerpt from the Book "Programming Microsoft Visual C#: The Language": A function evaluates to the return value. When a reference type is returned, a function is available as a left- or right-value of an assignment. Functions that return a value type are restricted to ri...more >>

Need Help getting values from bits.
Posted by Pete at 11/29/2006 12:36:30 AM
Hi, First, thanks for any time you spend helping me, I'm at a loss. I'm not bit-savvy, so I apologize if this is extremely simple, or I am going about this the wrong way. I am trying to take a byte array and extract some information from that array, and convert it back to a hex value. Fo...more >>

Code Snippet Insertion - Where Documented
Posted by Gary Brown at 11/29/2006 12:05:01 AM
Hi and Happy Holidays, While typing in a member function an errant finger triggered a bit of code snippet that throws a "not yet implemented" exception if the member is called. It happened three times in two days but I haven't been able to duplicate it purposely. Just what is the keying that...more >>

switch on string value
Posted by Peter Kirk at 11/29/2006 12:00:00 AM
Hi i have a string variable which can take one of a set of many values. Depending on the value I need to take different (but related) actions. So I have a big if/else-if construct - but what is a better way of doing this? if ("control" == commandString) { } else if ("execute" == command...more >>

Word document paragraph
Posted by Alan T at 11/29/2006 12:00:00 AM
If I place a table or graphic at the beginning of a Word document, does the wordDoc.Paragraphs[1] returns that? ...more >>


DevelopmentNow Blog