p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 4th, 2009, 05:50 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 5th, 2009, 04:23 AM
samjudson's Avatar
Friend of Wrox
Points: 4,336, Level: 27
Points: 4,336, Level: 27 Points: 4,336, Level: 27 Points: 4,336, Level: 27
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 1,340
Thanks: 0
Thanked 26 Times in 26 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 -/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to samjudson For This Useful Post:
black2 (July 7th, 2009)
  #3 (permalink)  
Old July 7th, 2009, 04:07 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old July 7th, 2009, 05:11 AM
samjudson's Avatar
Friend of Wrox
Points: 4,336, Level: 27
Points: 4,336, Level: 27 Points: 4,336, Level: 27 Points: 4,336, Level: 27
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 1,340
Thanks: 0
Thanked 26 Times in 26 Posts
Default

You can try using FileShare.ReadWrite perhaps?
__________________
/- Sam Judson : Wrox Technical Editor -/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 10:01 AM
LINK CSV FILE paul20091968 Access 5 April 25th, 2006 09: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 05:39 AM



All times are GMT -4. The time now is 03:22 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc