Determining the position of sdf file in the OLE DB.Net

This article explains the connection string used to determine the position of sdf file.
  • 1464

Specifying the sdf path sometimes becomes a necessity as the sdf database may not be executing in the same/ current directory.  Sdf files are advantageous to the users as we do not need to apply extra efforts in copying this file as we move our project to a different machine.

Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\MyData.sdf;

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.