Hello, I'm learning ado.net in C#.
I have a VB6 background so I wanted to ask you that if I want to change the location of my program and still access it how do i do that ?
In VB6 we used to have App.path.
What is it in C# ?
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:/DVDLogger/dvdLog.accdb";
Where in my code do I put the App.path replacement for c# ?
Loading
Jignesh TrivediPosted Jul 22, 2012, 11:33 PM
Where is your code?
kindly attach you code so we may edit it.
thx.
Waqas AliPosted Jul 20, 2012, 11:35 AM
Jignesh TrivediPosted Jul 20, 2012, 8:03 AM
try
// it give path application path\bin\Debug
//basically it return path where you application exe located
string appName = Environment.CurrentDirectory;
hope this will help you.
Satyapriya NayakPosted Jul 20, 2012, 6:56 AM
App.config
Call in windows app as,
string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["dsn"];
Refer one example
http://www.c-sharpcorner.com/Blogs/9700/display-sum-the-values-of-the-datagridview-cell-columns-in-d.aspx
Thanks
Satyapriya NayakPosted Jul 20, 2012, 6:48 AM