) What is datadirectory?

Source: Internet
Author: User

Asp.net 2.0 has a special directory app_data. Generally, the SQL Server 2005 express data file is stored in this directory. The corresponding database connection string is:
Connectionstring = "...... Data Source =. \ sqlexpress; Integrated Security = sspi; attachdbfilename = | datadirectory | data. MDF; user instance = true"
Here is a macro of datadirectory. What does it mean?
Datadirectory indicates the replacement string of the database path. Datadirectory simplifies project sharing and application deployment because it does not require hard coding of the complete path. For example, you do not need to use the following connection string:
"Data Source = c: \ Program Files \ MyApp \ app_data \ mydb. MDF"
Use | datadirectory | (included in the following vertical line) to have the following connection string:
"Data Source = | datadirectory | \ mydb. MDF"
Datadirectory is not only used in SQL Server 2005 Express, but can also be used in other file databases, such as the connection string of the sqllite database file:
<Add name = "defaultdb"
Connectionstring = "driverclass = nhib.pdf. Driver. sqlite20driver; dialect = nhib.pdf. dialect. sqlitedialect; Data Source = | datadirectory | \ data. db3"/>

This article is from the csdn blog,

Source: http://blog.csdn.net/leon_ice/archive/2009/08/08/4426281.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.