Wrox Programmer Forums
|
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 4th, 2009, 04:50 PM
Registered User
 
Join Date: Jul 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs down read from csv file

hi
i want to read from csv file, that file write with another program and i must read data in files in my program! i try it...

FileStream FS = newFileStream(strFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
StreamReader SR = newStreamReader(FS, Encoding.Default);
string AllText = SR.ReadToEnd();

error :
used by another procsess...


plz help me
 
Old July 5th, 2009, 03:23 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you get an error saying it in use by another process, then it is in use by another processor. Try getting hold of FileMon from Microsoft to see who has the file locked.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
black2 (July 7th, 2009)
 
Old July 7th, 2009, 03:07 AM
Registered User
 
Join Date: Jul 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by samjudson View Post
If you get an error saying it in use by another process, then it is in use by another processor. Try getting hold of FileMon from Microsoft to see who has the file locked.
I downloaded fileMon from microsoft! i know who has the file locked, (another program that write to the file and lock it) and my program can't access to read from file but excel access to read from file in mode read-only
 
Old July 7th, 2009, 04:11 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You can try using FileShare.ReadWrite perhaps?
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read CSV file - Save Columns into Rows pintoo BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 1 August 20th, 2008 09:01 AM
LINK CSV FILE paul20091968 Access 5 April 25th, 2006 08:28 AM
save as CSV file cdsniti Java Databases 1 December 21st, 2005 07:26 AM
ASP to read .CSV into Access liquidmillsap Classic ASP Databases 1 January 4th, 2005 11:01 AM
read csv file ccc_storage Classic ASP Professional 2 August 21st, 2004 04:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.