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# > march 2007 > threads for tuesday march 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

sealed methods, why to include the override modifier
Posted by muler at 3/27/2007 11:59:45 PM
"If an instance method declaration includes the sealed modifier, it must also include the override modifier." The C# Programming Language, =A7 10.5.5 Sealed Methods Why is this? Thanks, Mulugeta ...more >>


How to enumerate a ToolStripMenuItems's events
Posted by Lilian at 3/27/2007 11:44:01 PM
Hi, In a Windows Form I created a set of ToolStripMenuItems. I am looking for a method to list, for a specific ToolStripMenuItem, the Click EventHandlers (if any) so as to add them to another control. I found System.Reflection.EventInfo class which seems to achieve this kind of enumerat...more >>

Memory corruption, problem closing multiple forms.
Posted by Pucca at 3/27/2007 11:16:03 PM
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought I'll make the inactive forms invisible but this is creating a memory corruption problem when user...more >>

Working of static constructor in case of Generic Types
Posted by rvmaccount at 3/27/2007 10:36:01 PM
It seems the static constructor is supposed to be called, ONLY once for a particular type. If that's the case, why does the following code throws an exception? using System; using System.Collections.Generic; using System.IO; namespace GenericTypes { class Program { st...more >>

A problem with AutoResetEvent
Posted by Maqsood Ahmed at 3/27/2007 10:34:36 PM
Hello, We have been experiencing a problem with AutoResentEvent class for past 2-3 months. It seems that it just stops at WaitOne and the thread doesn't released from blocking state. We have been using the following code for past 4 years, and It was working perfectly fine till Nov-Dec last ye...more >>

Alternative way to write queries: Parameterized queries .... i guess
Posted by weird0 at 3/27/2007 9:46:49 PM
i write query in this manner by contatenting a string: cmd.CommandText = "SELECT acc_name FROM Account_Information where user_id='" + User_Id + "'"; Is there any other way to do it.... please tell me how to do so and some good link related to that? ...more >>

downloading a single file using multiple threads
Posted by keerthyragavendran NO[at]SPAM gmail.com at 3/27/2007 9:44:32 PM
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from 500000 to 3200000 of a file whose size is say 20MB... how do i request a download which starts directly ...more >>

Changing a form's location
Posted by Tharpa Roberts at 3/27/2007 9:27:46 PM
I'm trying to make a button that will change the location of the form. I would have thought that the following code would do the trick: this.Location.X = this.Location.X + 1; however, this gives me the error: this.Location.X = this.Location.X + 1; Any suggestions? ...more >>



Check to see if a pc is on before attempting file.copy
Posted by RvGrah at 3/27/2007 8:23:22 PM
I've built a small app to deploy my apps in a small domain, just for my own use when I make small updates to pass to my end users. My app uses File.Copy, and works fine except that it takes a long time to fail if the machine I'm copying to is in standby, turned off or hibernating etc. How cou...more >>

Debugging & reference to .dll files
Posted by Zeba at 3/27/2007 7:34:25 PM
Hi, My client has given me some files in .dll form rather than the source code itself ( say X.dll instead of X.cs ). So while debugging, at points where there are references to functions in X.cs, I have to "Step over" rather than "Step into" - Is that correct ? If I try step- into I get an er...more >>

DataAdapter select assuming integer
Posted by tshad at 3/27/2007 7:08:56 PM
How do I tell DataAdapter that Column 2 and 3 are string and not integer? Following is the example data that comes from the .csv file FEDERAL TAX,1084,0000 COREHCR,1084,0000 CLIENT P,1084,0000 The select is: OleDbDataAdapter da2 As New OleDb.OleDbDataAdapter("Select * from " & "Corela...more >>

Raising and event
Posted by Lubomir at 3/27/2007 7:07:24 PM
Hi, I have an app with the main thread and one additional thread. In the main thread I defined an event handler MyHandler, the function for raisin this event OnMyEvent and the function for processing this event MyFunc. I want to raise this event from the second thread. Is it thread safe t...more >>

convert DateTime to UTC
Posted by John Grandy at 3/27/2007 6:51:58 PM
Does the .NET framework provide a method, provided a TimeZone instance and DateTime in that TimeZone, returns corresponding UTC DateTime ? If so, does this method work in all cases ? Especially considering the recent US DST changes. ...more >>

Circular reference
Posted by sippyuconn at 3/27/2007 6:43:41 PM
Hi I Have a solution with about 50 projects and each project have References to 1 to n of the projects in the solution. I try go to a project and try to add a reference to another project and I get a Circular Reference" error and cannot reference the project. Is there any way to find ou...more >>

Access web page without IEXPLORE.EXE
Posted by [Joe] at 3/27/2007 6:05:10 PM
Hi, I build an application that get a command from user and send it to server, but I'm using Internet Explorer for that as following : psi = new System.Diagnostics.ProcessStartInfo("IEXPLORE.EXE"); psi.Arguments = "http://xxx.xxxx.60.3/webdialer/Webdialer?destination="+this.mytestBox.Text...more >>

I need to retrieve and open a file stored on a Unix server on a ne
Posted by Pucca at 3/27/2007 5:18:53 PM
I need to retrieve and open a file stored on a Unix server on a network and opens the file as a delimited text file. I'm using VS2005, .net 2.0 and C#. What's the best way to do this and if there's any sample code online? The user would enter something like; \\serverName\filename or \\ipad...more >>

DAAB(Data Access Application Block) 2.0 connection problem.
Posted by MikeZ at 3/27/2007 5:18:45 PM
I created a function to use DAAB return a datareader. The connection must keep opening when I consume the datareader. 1. I tested the function, it works. Even I use the datareader after 10 seconds. 2. DAAB document said that it manages the connection. 3. From .NET programming point view, n...more >>

Converting C# string to char*
Posted by rkpat at 3/27/2007 5:18:41 PM
i'm calling a C++ DLL from C#. here's C++ interface: char* __cdecl SendCmd(void* handle, char* cmd, char* data, char* buffer); here's my call in C#: [DllImport("somedll.dll", CharSet = CharSet.Auto, EntryPoint = "SendCmd")] unsafe public static extern byte* SendCmd (void* hReader, [Marsh...more >>

validate that string input is a negative number
Posted by diatom NO[at]SPAM newsgroup.nospam at 3/27/2007 4:17:45 PM
Hello, I have a data entry windows form. One of the text boxes allows the user to enter a string. I need this text box to only allow users to type in a negative integer value (e.g. -1, -2, -3). Current approach: I want to validate the user's entry during the TextChanged() event. Duri...more >>

Asynchronous Programming Model
Posted by mk at 3/27/2007 4:15:07 PM
Hi everyone, I need to refactor some of our processes using the asynchronous programming model. I have defined a couple of arrays of delegates to pipline the asynchronous invocations through different stages of execution. However I was wondering if there was any information available regard...more >>

Question about unpack
Posted by dorian at 3/27/2007 4:14:19 PM
Dear friends, I am trying to get information from a SEGY file. This format is used to handle seismic data. The first 3200 bytes are in EBCDIC format. The following 400 bytes of the format are the binary header. Every variable in this header occupies 2 or 4 bytes. I developed a program in perl th...more >>

simple date time question!
Posted by JamesG at 3/27/2007 4:02:34 PM
Hi, I need to convert the current time to the format "hh:mm:ss" and date to the format "yyyy-MM-dd". The result of both conversions needs to be of System.DateTime format. I've tried using DateTime.ParseExact and DateTimeFormatInfo but failed, most examples I see convert the final result to ...more >>

ado connection fail on Vista
Posted by paolol at 3/27/2007 4:01:37 PM
Hi, I just finish to install VS2005 on vista and my proget is not working on Connessione = new ADODB.ConnectionClass(); I get an error, so I went to the MS site and downloaded the MDAC_TYP version 2.8 , that is suppose to solve this error. Bu I still get the error and I have no more cl...more >>

Customizing a ComboBox
Posted by michael sorens at 3/27/2007 3:56:47 PM
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the selected index to the item (without adding a duplicate). I know the basics of inheriting from u...more >>

DLL with message loop
Posted by zhouzuo NO[at]SPAM gmail.com at 3/27/2007 2:48:48 PM
Hi I want to re-write a C# application(exe) to C# DLL. This application starts by myApp.MainApplication app = new myApp.MainApplication(); Application.Idle += new EventHandler(app.myApp.OnApplicationIdle); Application.Run(app); But when I move all the...more >>

Dataset Object updating
Posted by tshad at 3/27/2007 2:38:07 PM
Is there a way to update a DataSet Object? I have a Dataset Object (DataSetObj.Tables(0) - one table) that I read in from a .csv file. I normally do the following to get my data from the .csv: DataSet DataSetObj As New DataSet; DataTable DTDepartment As New DataTable; DataTable dt As New...more >>

Q: Need tip on compressing files.
Posted by Martin Arvidsson, Visual Systems AB at 3/27/2007 2:34:16 PM
Hi! I have a service running on a main server. What i want to do is to compress the files before i send them to an FTP site. Is there a built in compression tool in the .NET Framework 2.0 or do i have to use the zip functionallity. Anny suggestions, links are warmly welcome... Rega...more >>

Converting Doubles to Strings
Posted by nvx at 3/27/2007 12:20:51 PM
Hi, I'm looking for a simple way to convert a Double to a String exactly the .ToString() does, except these two differences: - the number of decimals is given (rounding is applied if necessary), and - trailing zeroes are kept. This means I need it to be converted using the scientific not...more >>

Build reports?
Posted by wojtek at 3/27/2007 10:56:10 AM
Hello, I need to develop group of reports based on information from daily build. I am interesting abort your experiences with build and reports. Do you analyze information from daily build and source code? When yes, can you tell me what kind of reports you are using for this? ...more >>

Fortran files in C#?
Posted by not_a_commie at 3/27/2007 10:26:42 AM
Is anyone aware of a .NET API to ease reading and writing Fortran files? I want to load some Fortran files into my own structures. They are a bit of a pain parsing with Regex because 1) they have like 200 fields, 2) some of the fields are files that may or may not be embeded (using the Fortran $...more >>

(WebBrowser.Document == null) throws InvalidCastException
Posted by Zytan at 3/27/2007 10:21:28 AM
if (webBrowserControl.Document == null) is throwing an InvalidCastException. PLEASE NOTE: ***The function being called is being called from a thread OTHER THAN than the one that created the WebBrowser control.*** So, I think making a delegate to invoke the function from the proper thread wil...more >>

Select query that should return multiple rows: It does not
Posted by weird0 at 3/27/2007 9:31:11 AM
The given should return A,B that is two rows because both accountnames A and B have the same user_Id=1 but it is only returning A when I performed the op. MessageBox.Show("AccountNames:" + Object.ToString() ); [WebMethod] public Object GetAccountNames(string User_Id) { //s...more >>

How to create a .txt file with unicode encoding
Posted by ujjwaltrivedi NO[at]SPAM gmail.com at 3/27/2007 9:18:53 AM
Hey guys, Can anyone tell me how to create a text file with Unicode Encoding. In am using FileStream Finalfile = new FileStream("finalfile.txt", FileMode.Append, FileAccess.Write); ###Question: Now this creates finalfile.txt with ANSI Encoding ...which is a default. Either tell me how to ...more >>

Why is the second element in this XML not being picked up?
Posted by chance at 3/27/2007 7:14:34 AM
my code: //read XML and append XmlReader rdr = XmlReader.Create("parms.xml"); while (rdr.Read()) { //get name and value to prepare clause if (rdr.NodeType == XmlNodeType.Element) { ...more >>

current directory of WebBrowser control
Posted by titan.nyquist NO[at]SPAM gmail.com at 3/27/2007 6:58:13 AM
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control isn't the current directory of the program. What is the current directory? I don't want to use an ...more >>

Parsing XML
Posted by chance at 3/27/2007 5:47:49 AM
I need to parse this XML <?xml version = "1.0" encoding="utf-8" ?> <parms> <collumn>notice_of_violation.notice_of_violation_id</collumn> <value>A1000125</value> </parms> In particular, I am going to use it to dynamically build a WHERE clause to be used against my Oracle database. ...more >>

reflection
Posted by Harish Krishnan at 3/27/2007 5:02:25 AM
..NET Assembly CustomerInfo.dll has a class by name CustomerInfo which inturn has two methods GetCustomer() and GetCustomerDetails() and GetCustomer() calls GetCustomerDetails(). GetCustomerDetails() takes two input parameters, Stored Procedure Name and Customer Id and returns a dataset. We wa...more >>

.NET Reflection
Posted by Harish Krishnan at 3/27/2007 4:54:31 AM
..NET Assembly CustomerInfo.dll has a class by name CustomerInfo which inturn has two methods GetCustomer() and GetCustomerDetails() and GetCustomer() calls GetCustomerDetails(). GetCustomerDetails() takes two input parameters, Stored Procedure Name and Customer Id and returns a dataset. We wa...more >>

Excel addin not loading
Posted by shantanu at 3/27/2007 4:42:22 AM
Hi All I have developed an excel addin in C#. Its working fine on my PC but when i install in a diffrent PC it does not load. I checked with the registry, the entries for the addin setup are present. Please assist what the problem can be. regards shantanu ...more >>

c# transactions in 2.0 intermittently differs from 1.1?
Posted by a95johjo NO[at]SPAM hotmail.com at 3/27/2007 3:38:55 AM
Hello I'm making an update in c# ASP.NET 2.0 using the OleDb provider for SQL Server. I have an existing application running on 1.1 that works fine. Now I want to convert it to 2.0. My problem is that within the transaction, a read after an update/ insert will read the old commited values. The...more >>

Enumerate Drive letters on remote computer and free space on HD
Posted by Miguel Pires at 3/27/2007 2:46:45 AM
Hi, Any one knows a way to get Hard Drive letters and free space (C: / D: ....) from a remote computer? I'm developing one application that needs to know if a second drive exist on that system and i need to know the free space from the root drive and from the second drive in case of exist. Th...more >>

httpwebrequest for no http headers
Posted by Will at 3/27/2007 1:42:01 AM
I have a hardware device that I need to read from. To connect to it you do a http://<name>/data and it return a few string of raw data(non- HTML format and no HTTP header). I just need to put that full return into a string and I would be good to go. I orginally tried WebClient and had problem...more >>

Waiting for a Process to Finish
Posted by bg_ie NO[at]SPAM yahoo.com at 3/27/2007 12:43:12 AM
Hi, I'm starting a process as follows - Process process = new Process(); process.StartInfo.UseShellExecute = false; process.StartInfo.FileName = installValue + "\\Lib\\site-packages\ \pythonwin\\Pythonwin.exe"; process.StartInfo.Arguments = "/run " + script; process.Start(); process.Wa...more >>

threads co-ordinating access to a method
Posted by Peted at 3/27/2007 12:00:00 AM
Hi i hope i explaine this correctly I have a class with a method that reads and writes using blocking sockets to a TCP device. Call it class IPdevice. I can use this method to send commands and then wait for a response from this ipdevice im connected to i want to have a background worker t...more >>

System.Collections.Generic.List
Posted by Kuldeep at 3/27/2007 12:00:00 AM
Framework: Visual Studio 2005, ASP.NET Programing Language: C#.NET I am using a Generic List Collection to fetch a particular master data from the database. Once collected, I use this Collection to bind it to a DataGrid. Now that I am using a Generic List Collection to populate the DataGrid...more >>

How to get HTML code for a web address
Posted by Ashutosh at 3/27/2007 12:00:00 AM
hi I am developing a windows application, which needs to get a html code for a web address. Can someone please guide me in this?? Regards, Ashutosh ...more >>


DevelopmentNow Blog