Home > DeveloperSection > Forums > How use relative path in C#.
Kenny Tangnde

Total Post:68

Points:476
Posted on    October-11-2011 2:25 AM

 C# C# 
Ratings:


 5 Reply(s)
 3916  View(s)
Rate this:

Hi all,

 How use relative path in C#.

Such as:

con = new OleDbConnection(@"provider=microsoft.jet.oledb.4.0;data scource=C:\MyProject\Product.mdb");

 

thanks.



Chris Anderson
Chris Anderson

Total Post:65

Points:455
Posted on    October-11-2011 3:58 AM

Hi,

You can use relative path by using GetFullPath method of the Path class that exist in the System.IO namespace.
Try this:
         Console.WriteLine("The relative path 'file.txt' " + System.IO.Path.GetFullPath("file.txt"));

Kenny Tangnde

Total Post:68

Points:476
Posted on    October-11-2011 7:29 AM

Hi Rohit,

  thanks for your help.


Kenny Tangnde

Total Post:68

Points:476
Posted on    October-11-2011 8:10 AM

Hi Rohit,

You can give me some website address to learn SQL?

thanks in advance.


Chris Anderson
Chris Anderson

Total Post:65

Points:455
Posted on    October-12-2011 12:03 AM

Post is removed by the Admin.

Uttam Misra

Total Post:124

Points:888
Posted on    October-12-2011 12:54 AM

Aken ...here you go..
https://www.mindstick.com/DeveloperSection/Beginner
Join mindstick beginners section...
Cheers!

Modified On Mar-14-2016 08:21:28 AM

Don't want to miss updates? Please click the below button!

Follow MindStick