Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Write contents of dataset into email Pin
<<Tash18>>15-Feb-11 21:39
<<Tash18>>15-Feb-11 21:39 
GeneralRe: Write contents of dataset into email Pin
Hum Dum15-Feb-11 21:55
Hum Dum15-Feb-11 21:55 
AnswerRe: Write contents of dataset into email Pin
Luc Pattyn16-Feb-11 0:50
sitebuilderLuc Pattyn16-Feb-11 0:50 
AnswerRe: Write contents of dataset into email Pin
PIEBALDconsult16-Feb-11 1:51
mvePIEBALDconsult16-Feb-11 1:51 
Questionget relative path Pin
igalep13215-Feb-11 12:18
igalep13215-Feb-11 12:18 
AnswerRe: get relative path [modified] Pin
Luc Pattyn15-Feb-11 12:38
sitebuilderLuc Pattyn15-Feb-11 12:38 
GeneralRe: get relative path Pin
igalep13215-Feb-11 12:42
igalep13215-Feb-11 12:42 
GeneralRe: get relative path Pin
Dave Kreskowiak15-Feb-11 15:21
mveDave Kreskowiak15-Feb-11 15:21 
igalep132 wrote:
Directory.GetCurrentDirectory(),


This is about the worst way you can do this. The thing everyone doesn't realize about GetCurrentDirectory is that the currect directory can unexpectedly change or start in a folder you didn't expect to begin with. Don't make the mistake of believing that just because your app was just launched and the first thing you did was GetCurrentDirectory that you're going to get the path to the folder your .EXE was launched from. What if someone created a shortcut to your app and set the "working directory" to C:\Windows? Guess which folder GetCurrentDirectory is going to return...

Use Luc's example and build the path correctly. Don't use string concatentation to build the folder path either. Use Path.Combine instead.

QuestionLINQ to Entities Pin
Tamimi - Code15-Feb-11 4:52
Tamimi - Code15-Feb-11 4:52 
AnswerRe: LINQ to Entities Pin
Pete O'Hanlon15-Feb-11 5:29
mvePete O'Hanlon15-Feb-11 5:29 
GeneralRe: LINQ to Entities Pin
Tamimi - Code15-Feb-11 5:47
Tamimi - Code15-Feb-11 5:47 
GeneralRe: LINQ to Entities Pin
PIEBALDconsult15-Feb-11 6:31
mvePIEBALDconsult15-Feb-11 6:31 
GeneralRe: LINQ to Entities Pin
Pete O'Hanlon15-Feb-11 6:50
mvePete O'Hanlon15-Feb-11 6:50 
AnswerRe: LINQ to Entities Pin
musefan15-Feb-11 5:54
musefan15-Feb-11 5:54 
GeneralRe: LINQ to Entities Pin
PIEBALDconsult15-Feb-11 6:28
mvePIEBALDconsult15-Feb-11 6:28 
GeneralRe: LINQ to Entities Pin
musefan15-Feb-11 6:50
musefan15-Feb-11 6:50 
GeneralRe: LINQ to Entities Pin
Rob Philpott15-Feb-11 8:29
Rob Philpott15-Feb-11 8:29 
GeneralRe: LINQ to Entities Pin
Not Active15-Feb-11 10:11
mentorNot Active15-Feb-11 10:11 
AnswerRe: LINQ to Entities Pin
PIEBALDconsult15-Feb-11 6:34
mvePIEBALDconsult15-Feb-11 6:34 
AnswerRe: LINQ to Entities Pin
Luc Pattyn15-Feb-11 6:56
sitebuilderLuc Pattyn15-Feb-11 6:56 
GeneralRe: LINQ to Entities Pin
PIEBALDconsult15-Feb-11 7:02
mvePIEBALDconsult15-Feb-11 7:02 
GeneralRe: LINQ to Entities Pin
Pete O'Hanlon15-Feb-11 7:31
mvePete O'Hanlon15-Feb-11 7:31 
AnswerRe: LINQ to Entities Pin
OriginalGriff15-Feb-11 9:48
mveOriginalGriff15-Feb-11 9:48 
GeneralRe: LINQ to Entities Pin
PIEBALDconsult15-Feb-11 10:21
mvePIEBALDconsult15-Feb-11 10:21 
GeneralRe: LINQ to Entities Pin
OriginalGriff15-Feb-11 21:18
mveOriginalGriff15-Feb-11 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.