are.ehibou.com

January 30, 2009

c#.NET file acces denied problem

Filed under: C#.NET, Side Notes — Tags: , — admin @ 4:03 pm

I was trying to access a file with the user having only read permission. the code looked like:

FileStream fs =new FileStream(
"c:\path\to\file.ext",
FileMode.Open);

and it uset to throw exception “access denied”. After some investigations I’ve found that FileAccess.Read helps a lot.

FileStream fs = new FileStream(
"c:\path\to\file.ext",
FileMode.Open,
FileAccess.Read);
  • Share/Bookmark

September 8, 2008

Generic Configuration Section Handler

Filed under: C#.NET — admin @ 12:55 pm

Check this link. It is a good way to deal with configuration sections in .NET environment.

  • Share/Bookmark

July 24, 2008

C# .NET project fails to compile because of System.Data.SqlClient SortOrder data type.

Filed under: C#.NET, Side Notes — admin @ 1:29 pm

Had a headache because of compilation of project which was using System.Data.SqlClient SortOrder data type. After some hours of investigations we found out that Microsoft .NET framework 2.0 SP1 was not installed on the machine. .NET 2.0 contains system.Data.SqlClient namespace but not SortOrder type in it. SP1 adds this data type to the namespace mentioned above.

Check this on microsoft.

  • Share/Bookmark
Older Posts »

Powered by WordPress