Determining the position of sdf file in the SQL server

This article explains the position of SDF file in SQL Server.
  • 1498

Determining the position of sdf file in the SQL server

A SDF file is a Sql Server Mobile file which is mainly used in mobile development. But in recent years it is used in single user desktop developments also. It is basically regarded as a database. An advantage of SDF file is that generally we don't need to copy this file when we move our project and it will be automatically transported in the new location once we open your project. Many times we need to specify the path to the sdf file as it may not be in the current directory. To implement it we may use the following string.

Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\companyData.sdf;Persist Security Info=False; 

Ask Your Question 

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

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.