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# > january 2004 > threads for tuesday january 27

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

Encapsulating SqlDataReader and SQL
Posted by Adie at 1/27/2004 11:57:25 PM
Hi, just looking for tips and ideas from the experienced. I wondered if you guys encapsulate the SqlDataReader so as to allow simpler code with less duplation, if so what does your code look like and what methods do you provide? My first effort is below, it's pretty sparce :-) using Sys...more >>


Printing
Posted by Chris Mattmiller at 1/27/2004 11:54:30 PM
Does anyone know how to hard code the size of the paper being printed on? I am printing onto labels. Here is what I came up with, but I don't know what goes after the equals sign: printDoc.DefaultPageSettings.PaperSize = ; Thanks Chris ...more >>

Where are the pictures going?
Posted by sp000n at 1/27/2004 11:41:07 PM
I've a two part question involving picture boxes. Firstly, where is the picture? When I changed the image by using the Properties interface in VS, I browsed my system for a file and selected it. Sure enough, it works just fine in the program. When I move/delete/change the picture, however, the c...more >>

Ending/restarting blocked C# thread using blocking Socket calls
Posted by roger_beniot NO[at]SPAM yahoo.com at 1/27/2004 11:24:50 PM
I have a program that launches multiple threads with a ThreadStart method like the following (using System.Net.Sockets.Socket for UDP packet transfers to a server): ThreadStart pseudo code: Connect Receive response Send Connect ACK Send request for wml page Receive wml page Disconne...more >>

Menu inside console application
Posted by Arjen at 1/27/2004 10:53:51 PM
Hello, I have made a main class. (main.cs) I also have made a menu class. (menu.cs) The reason that I separate is is just for the code overview. Now I want to see the menu calling from the main. The problem is is that I don't want to make an object... Is there not a way that I call the men...more >>

Function Delegation
Posted by R. Ian Lee at 1/27/2004 8:46:05 PM
We have a project that we are developing in C# and one of our biggest requirements is that this be a single application but that many of the functions be customized depending on which cost center the user belongs to. In reality, what this typically means is that the user interfaces are the same eve...more >>

Look for Example Spread 6.0 from FarPoint
Posted by Christina Feichter at 1/27/2004 8:25:09 PM
Hi I work in VB6 with Spread 6.0 from FarPoint can anybody show me an Example or any Exaples (C#) like this. VB6 Dim x, y as Integer GetText(1, 1, x) y = x * 2 thanks Chr....more >>

How to Invoke a http on executable
Posted by Rudy Ko at 1/27/2004 8:03:04 PM
Hi, I want to get some data over http potocol within a csharp standalone executable. Can you help? Thanks, Rudy ...more >>



Repaint Event
Posted by Tamir Khason at 1/27/2004 7:28:25 PM
Is there something RePaint event? I have a couple of controls where I draw using control.CreateGraphics, BUT when I lost focus or do something inside the contorl (click ,etc) all graphics are disappears What the name of the event to handle in order to be able to repaint the graphics on lost? ...more >>

theoretic question
Posted by fleimeris at 1/27/2004 6:16:39 PM
hello, why do we need explicit cast here ? short i = 0; //i = i + 1; // Cannot implicitly convert type 'int' to 'short' //i = i + (short)1; // Cannot implicitly convert type 'int' to 'short' i = (short)(i + 1); thanks, fleimeris ...more >>

VBA & C#
Posted by JPRoot at 1/27/2004 6:11:56 PM
Hi, Is it possible to integrate VBA within a C# MDI application? If yes, is there any exemples? What I am trying to do is let the user of my app add any child windows he would like to the MDI and customize their layout using VBA... Any ideas? Thanks JPRoot ...more >>

custom event
Posted by Tamir Khason at 1/27/2004 6:08:42 PM
How to create custom event from code (as well as build property) set { } get { } Than kyou ...more >>

I need a classroom equivalent the "Class List" of c++,
Posted by '[] WiRaN at 1/27/2004 5:47:23 PM
I all, I need a classroom equivalent the "Class List" of c++, necessary to recoup given of some hands tanks, Bruno ...more >>

StringDictionary Item Property for C#
Posted by Wamiq Ansari at 1/27/2004 5:39:56 PM
Hi!, I am trying to add a value to a StringDictionary using its Item Property in C#. However this throws an expection as follows: Cannot implicitly convert type 'Component.TemplateComponent' to 'string'. The method I am using is as follows: private StringDictionary componentList = new Strin...more >>

C# XML Support
Posted by David at 1/27/2004 5:39:18 PM
Hi, I'm a newcomer to C# and I just wondered what the easiest way would be to read, write and modify an XML document from my C# program. If you could point me to a few good resources, it would be much appreciated. Thanks, David. ...more >>

BUG: Periods / Fullstops removed from MailMessage attachments
Posted by Simon Knox at 1/27/2004 5:18:59 PM
Hi I have come across an apparant bug while using SmtpMail. The problem I have is that if a MailAttachment has a line in it that starts with a fullstop ( or period for those of you that speak American english ) then the fullstop is removed. This is an example of how I am using SmtpMail and Mai...more >>

any secure ftp library
Posted by Mullin Yu at 1/27/2004 4:33:54 PM
i want to find a secure ftp library for uploading and downloading files. ...more >>

multiple constructors - can they call each other?
Posted by Mark at 1/27/2004 4:25:58 PM
public class myClass { public myClass(string param1) { //HOW DO I CALL myClass() below?? myClass(); // THIS DOES NOT WORK } public myClass() { //Do something here that ALL constructors should do. Hence, I want to call it from } } NOT...more >>

primitive types
Posted by Mark at 1/27/2004 4:06:54 PM
What is the difference between declaring variables like ... string strSomething; versus String strSomething; My understanding is that the first uses a primitive type, and the second creates an instance of a String class. While it likely will never make a difference, is there reaso...more >>

Code is Deleted/Disappears from InitializeComponent() Wnform
Posted by ed NO[at]SPAM hatcorp-dot-com.no-spam.invalid at 1/27/2004 3:59:02 PM
A *lot* of our teams code is being deleted from the InitializeComponent() section of a winform, such as Grid settings, event handler hooks, layout settings etc. This mainly seems to happen to 3rd party controls such as Infragistics grids and menu bars and toolbars, but it also happens on native...more >>

why member inaccessible?
Posted by Marty McDonald at 1/27/2004 3:37:18 PM
public class BaseDALC { //Don't allow instantiation private BaseDALC() // To compile properly, I had to change this to "protected" { } } .... public class StatisticsDALC : BaseDALC { } error CS0122: 'AirportInformation.DAL.BaseDALC.BaseDALC()' is inaccessible due to its prot...more >>

Disk Info ?
Posted by WJ at 1/27/2004 3:19:48 PM
I m querying the "Win32_DiskDrive" Class found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_diskdrive.asp to extract Disk Information. The missing part is the "n bytes used" for a selected device (ie. local hard disk). Where can I find this in c# ? Thank...more >>

cast from "array of byte" to "array of struct"
Posted by xpulpo NO[at]SPAM hotmail.com at 1/27/2004 3:18:19 PM
I have a C# method that reads Binary data (BLOB type) from a database and returns the data an array of bytes (i.e byte[] outbyte = new byte[bufferSize];). The BLOB column is saved into the database by a C program (UNIX) as an array of "struct point" where struct point //C structure { ...more >>

stack size
Posted by jordi at 1/27/2004 3:15:48 PM
I have a recursive program and a typical stackoverflow exception, i need modify the stack size , how can i do it? ...more >>

DataSet
Posted by The Bear at 1/27/2004 3:07:14 PM
I'm loading a text file into a dataset. How can I simply display the table without having to navigate from the parent? thanks, TB ...more >>

Data validation for structs and classes?
Posted by Gustaf Liljegren at 1/27/2004 2:42:42 PM
Here's a very general programming question. I often wonder where to put the data validation when adding data to a struct or class, using its constructor. Suppose for example I got a class called Account with the variable Balance (float) and this variable shall not be negative. Shall I put this...more >>

Encryption issue
Posted by discussion NO[at]SPAM discussion.microsoft.com at 1/27/2004 2:26:42 PM
Hi, I am trying to encrypt and decrypt an XML string. I have it encrypting but decrypting is a problem, somehow the XML is getting all corrupted. Any ideas? Im saving the XML text to a byte[] and then encrypting that using DES, and writing it to a file and the reverse for reading it ...more >>

NT Authority\Network Service Error
Posted by mmc at 1/27/2004 2:16:08 PM
I'm getting the error "Login failed for the user NT Authority\Network Service" I'm running this application in visual studio and the app is supposed to fill a datagrid from an SQL Server Db. Could this be an ASPNET permission issue? If so what is the correct configuration private void binding( ...more >>

word access right
Posted by selen at 1/27/2004 2:07:03 PM
Hello, My problem is that: I want to open a word document and writing something in it then save it.But it give me granting access error.and say that:To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the ...more >>

window service cannot find initial. file
Posted by andrewcw at 1/27/2004 2:06:05 PM
Now that I have placed my class to be called as a service, the service does not know where the XML file for intialization ( deserilaization ) is. In my project I dropped the xml file in the bin directory. When I create and run the service I get my message that the file did not exist ( relative p...more >>

printf and format in c#
Posted by Mark at 1/27/2004 1:33:07 PM
Hi, how would I translate this to c#? char ttext[100]; sprintf(ttext,"%2.2i %-.10s %8.3f",1,"Mark",123.24); [expected output] 01 Mark<6spaces> 123.240 Thanks...more >>

how to tell when a file has been copied to a specific folder
Posted by Marco Martin at 1/27/2004 1:30:13 PM
Hi group, is there a way that I can fire an event when a file gets written to a specific directory without knowing where the file came from (it comes from another program)? regards, Marco ...more >>

Large solutions .NET language choice
Posted by Da~One at 1/27/2004 1:06:11 PM
This message has been posted to 2 groups, one to the VB.NET group, and the other to C#. I am trying to decide which language to commit to for a large scale project. I am looking for the input of people who have gone through this process before. I am currently leaning towards C# solely becau...more >>

Convert a String to a Byte Array?
Posted by Brian at 1/27/2004 1:06:08 PM
I have a string that I received from a web service call and I want to write it to a Stream. I cannot figure out how to access the string as a byte array and write it to the Stream. Any thoughts. I looked at Byte.Parse() but it will only convert a string represntation of a number and convert it to...more >>

Service Login -- API to Change it?
Posted by Camel Software at 1/27/2004 12:58:09 PM
I'd like to write a C# program that can change the login for a service that's already installed. I'm wondering if there is an API to use for that. I'm familiar with ServiceController, but I don't see a way to use it. Is it possible? If so, how should I approach it? Thanks, Steve Harclero...more >>

Custom Data Binding to Grid and TableStyles
Posted by sandman at 1/27/2004 12:32:25 PM
I've got some custom classes that implement IBindingList so I can bind them to a DataGrid. My test app works fine. So then I tried to format the columns - I have a function that creates a TableStyles object, formats all the columns, set the headers, column width, column order, etc. I tried ca...more >>

Dataset to an oracle stored procedure
Posted by Jawahar Rajan at 1/27/2004 12:24:31 PM
Is it possible for a Dataset that is added to a C# project to be based on a stored Procedure? Can I use either a OracleClient or Microsoft Oracle Client? Any help is appreciated. Jawahar ...more >>

How to read excel cvs file from C#
Posted by Andy Lee at 1/27/2004 12:22:16 PM
Could someone tell me how I can read excel csv (comma separated variable) file using C#? I know how to do it by parsing each line myself. Since reading excel csv file in C# is a pretty common technique, I just wonder whether there is a class or a way to do it out there already. Thanks, An...more >>

XML attributes, second stream?
Posted by phoenix at 1/27/2004 12:14:58 PM
Hello, I have the following code : ============ start of code ============ int number_of_children = 0; int some_random_number = 5; FileStream fs = new FileStream(@"c:\test.txt", FileMode.OpenOrCreate, FileAccess.Write); XmlTextWriter xw = new XmlTextWriter(fs, System.Text.Encoding.UTF8)...more >>

Setting the Screen Location of Windows Forms
Posted by G Uljee at 1/27/2004 11:56:42 AM
Hi all, I've some difficulties with the screen/form locations. When I fist set my location of the form and then the execute the show command the form is located at "WindowsDefaultLocation". Based on that I've created the following procedure: /// <summary>...more >>

Transpanent Textbox
Posted by Tamir Khason at 1/27/2004 11:52:32 AM
How can I create transpanent textbox? I have control with pictureBox and textbox on it. I want to make textbox transpanent in order to see the image on picturebox. How to do it (if possible)??? ...more >>

different fonts in a TextBox
Posted by Abubakar at 1/27/2004 11:44:41 AM
Hi ya'all, I want to know how can I write multiple font text in a textbox , like it can be done in a rich textbox? I DONT want to use richtextbox control. I want to write multiple size text with multi colored and multi-font text in one single textbox. Very IMp for me to Do This. Regards, n...more >>

DESCryptoServiceProvider
Posted by discussion NO[at]SPAM discussion.microsoft.com at 1/27/2004 11:44:31 AM
Hi, I have encrypted a bytestream with the SAME KEY and IV but both the output file is DIFFERENT. Shouldnt it be the SAME output for the same key and iv? Thanks. ...more >>

Any equivalent vbObjectError in c#
Posted by Mullin Yu at 1/27/2004 11:43:36 AM
hi in VB, we can have Err.Raise vbObjectError + <app_number>, ... where "<app_number>" is some application-defined error number. This will prevent your error numbers from conflicting with system-defined error numbers How do I do the similar at c#? Thanks! ...more >>

Dotfuscator problem with c# dll's
Posted by RA at 1/27/2004 11:20:42 AM
Hi I have a c# project who load some other c# assemblies. I took one of the dll assemblies and ran the Dotfuscator and produce the output assembly. I added this assembly to the project (add reference) and the project doesn't compile. It doesn't recognize the new added assembly. Whats wrong? D...more >>

How do you create a windows service property sheet?
Posted by PJ Olson at 1/27/2004 11:13:36 AM
In C++ we had the ability to create a property page that could be merged into an existing property sheet to provide customization inputs for users. Can anyone point me to an example of how to do this in C#? I am creating a windows service which has dynamic parameters that the user can change. In...more >>

RichTextBox Hangs Application
Posted by KenH at 1/27/2004 10:26:08 AM
I am getting an unhandled system exception while writing to a RichTextBox. The process may run for a few hours or days before the error is generated The message is "Cannot access a disposed object named RICHTEXTBOX." A check of the stack trace indicates the error is from the DLL that controls writi...more >>

Please Tell me what Am I doing wrong... Please
Posted by Franco, Gustavo at 1/27/2004 10:18:54 AM
Hi, I have a question, and please I need a answer. How can I finalize a thread running with Application.Run (I need the message loop!!!) without call Thread.Abort?. I want to call Application.ExitThread in the same thread that it is running. So, This is my example and I don't know ...more >>

Getting OS Language ??
Posted by Marcelo López at 1/27/2004 10:05:55 AM
How can i obtain the language installed in the pc where my win app is running ?? Regards Marcelo López Infocorp Latin América ...more >>

How to Execute a File ??
Posted by Marcelo López at 1/27/2004 9:52:08 AM
Hi all, i'm developing a win app and i need to execute a .bat in the main constructor (in the codebehind). Which is the easiest way to do that ?? Could anyone give me an exameple ?? Regards Marcelo López Infocorp Latin America ...more >>

Re: Data structure with sql "LIKE" searchability? - Jon
Posted by Derrick at 1/27/2004 9:50:52 AM
Hi Jon - Any chance you have a link to example opening an XmlDataDocument as DataSet, and then executing a sql command against it? I found the QuickStart sample app that loads books.xml and prints out structure, don't see how to run a "select * from books where name like '%blah%' against tha...more >>

Can I implicitly cast an enum variable to (int) without explicit casting
Posted by babylon at 1/27/2004 9:50:28 AM
I have an enum public enum MyEnum : int { X, Y } I have to do int a = (int) MyEnum.X; can i overload the operator or other means to do something like int a = MyEnum.X; ?? thank you! ...more >>

oledbParameter has no default value
Posted by Marco Martin at 1/27/2004 9:41:39 AM
Hi, I've got an oledb parameter that I'm sending to an Access DB. The table I'm sending it to has a column called "Zone" of type String that has a default value of "". So I create the parameter with its name and dbType, and add it to an Insertcommand. I then set the Command.Text value. ...more >>

Binary data with SQLite and C#
Posted by Alexander.Stuckenholz NO[at]SPAM Web.de at 1/27/2004 9:11:53 AM
Hello. I´m using the ado.net provider from sourceforge for SQLite database. Till now everything works fine. But today i tried to enter some binary data into one row. Here´s my code: command.CommandText = "INSERT INTO _files VALUES ('" + obj.ID + "','" + this.GetTimestamp() + "',?,'" + o...more >>

2nd thread locks up 1st thread?
Posted by Jon Davis at 1/27/2004 8:29:16 AM
I have a Windows Forms application where I normally had two threads running, with the second thread started by a main window. The second thread ran in the background just fine. Then I made some changes and I had the second thread initiated in a separate window ("owned" by the first thread)--a pr...more >>

CS1574 on <see cref="[explicit interface implementation method]">
Posted by trolipotlo NO[at]SPAM freemail.hu at 1/27/2004 8:26:32 AM
public class A : IComparable { int IComparable.CompareTo(object obj) { return 1; } } /// <summary> /// <see cref="A.System.IComparable.CompareTo"/> /// </summary> public class Form1 : System.Windows.Forms.Form { .... } warning CS1574: XML comment on 'mynamespace ..Form1' has...more >>

IList being updated and telling bound controlls
Posted by Jakob Nielsen at 1/27/2004 7:50:01 AM
I have implemented a container class with IList and bound it to a listbox. Works just fine, but if i then add a new item to my list, the listbox is not updated. Looking at the definition for IList it is clear that it does not have any events to tell the bound controlls about changes, but can i...more >>

string problem
Posted by Dave Bailey at 1/27/2004 7:36:04 AM
I am trying to use an if statement to obtain a return value to use somewhere else in my program. Can you look at this code and tell me what needs to be added to the code to keep from getting an unassigned local variable sortParameter error public string SortParameter( ...more >>

Get back Immediate window?
Posted by Jon Davis at 1/27/2004 6:46:16 AM
How do I get the Immediate window back? It seems to be gone. Command window doesn't work. "View" menu items don't seem to show it Jon ...more >>

BeginInvoke and Invoke
Posted by nick_tucker NO[at]SPAM hotmail.com at 1/27/2004 6:26:10 AM
Hi all, Are the two snippets below equivelent, since they both only continue once the ShowForm method returns??? 1. delShowForm del = new delShowForm(ShowForm); //show form shows a form IAsyncResult asyncResult = this.BeginInvoke(del); asyncResult.AsyncWaitHandle.WaitOne(); this.EndInvok...more >>

What makes someone an MVP?
Posted by Jax at 1/27/2004 6:11:11 AM
I thought at first it was Microsoft Verified Programmer in regards to a qualification you can earn from microsoft. I remember in another conversation an MVP said it mean Most Valued Programmer or omething like that. If that is the case what is the difference between an MVP and a non MVP? Just won...more >>

Regular Expressions
Posted by Mike at 1/27/2004 6:11:09 AM
I am trying to create a regular expression that will strip out all contents within my style tag. My string is this: <HTML><HEAD><STYLE type='text/css' MEDIA='print'>.MSGLINE {display:none;} </STYLE></HEAD></HTML>...more >>

When to use objects
Posted by Burns at 1/27/2004 6:06:08 AM
Hi, I'm quite new to C# and to Object-Oriented Programming in general. I've managed to get my head around most of the concepts, but I'm still not always sure when to use objects. Sometimes it's obvious when to make something into an object (such as database access code), but I tend to end up ...more >>

Using Regular Expressions
Posted by Mike at 1/27/2004 5:56:05 AM
I need some help. This regular expression strips out html tags "<>" /*Strips the HTML tags from strHTML */ Regex objStripHTML = new Regex("<(.|\n)+?>"); How would I construct a Regular expression to strip out one this code: <STYLE type='text/css' MEDIA='print'>.MSGLINE {display:none;} </ST...more >>

Binary OR
Posted by C# Learner at 1/27/2004 4:52:04 AM
I'm a bit baffled by this: Console.WriteLine(true | false); Surely that's binary, not logical, OR... right? And then there's this: Console.WriteLine(true || false);...more >>

Open a form dinamic
Posted by Bernardo at 1/27/2004 3:46:06 AM
Hi I have a textbox, and I want to open the form that is writen in it I tryed some code, but it didn't work Form oform = (Form)System.Reflection.Assembly.CreateInstance(txtNomeEcran.Text) Can you help Thanks ...more >>

VB programer having a C# newby question...
Posted by Bernardo at 1/27/2004 2:41:05 AM
Hi, In Visual Basic there are modules where I can store public variables, Constants, etc. I have in a C# program a class that have a method to open a form. public void GUIGestaoAcessos(string sDBUser, string sDBPassw, string sDBDsn) { Form oform=new FrmSeguranca(); oform.Show(); //He wil...more >>

Adding a control to a tab page
Posted by Liz at 1/27/2004 2:09:10 AM
I am trying to add a label to a tab page tabMain.TabPages[0].Controls.Add(aLabel); and get an error "specified argument was out of the range of valid values. Any ideas???...more >>

Damn beginners!...MAPI
Posted by Paul Brownjohn at 1/27/2004 1:27:46 AM
Hi I have just started progrmming in C#...its going OK so far..only minor problems. I need to create and send an email from a C# prog. I use W2K, Outlook 2000/ IE/Outlook Express 6. There is an article on the MSDN site that suggests that you need to download some special versions of Office...more >>

Bluetooth Support in C#
Posted by David at 1/27/2004 12:59:15 AM
I was wanting to write a Bluetooth application in C# that could 'talk' to my mobile phone. I have so far struggled to find any API/information on developing with C#. Can anyone help me or will I have to wait for the next release of the .NET framework?? Thanks again, David. ...more >>

Help! C# calling Java Program
Posted by David at 1/27/2004 12:56:44 AM
Hi, I am writing a C# program and want to run a java application and pass it a filename as a parameter. I want to be able to write a method in C# that will run this Java app for me. Eg. I want to run the following command: java MyApplication filename.extension Can anyone help me? Man...more >>

Invocation by reflection
Posted by Bevo at 1/27/2004 12:41:07 AM
I'd like to create a form by reflection. My forms' constructor takes 3 arguments so I have to use the 'long' CreateInstance overload as described below. Assembly assembly = Assembly.Load("<myassembly>"); object oForm = assembly.CreateInstance("<myform>", true, BindingFlags.Default, null, <myctor...more >>

Special chars in C# comments
Posted by LellD at 1/27/2004 12:31:54 AM
It seems not unusual for me that I have special chars like < (less than) or > (greater than) in C# comments, especially in <code> sections. For instance, <code> if(a<b) c=3; </code> should be a valid comment, but the '<' in the if statement is treated as beginning of a new XML token and lea...more >>


DevelopmentNow Blog