Hi, --Maybe helpfulYou can read it as a binary file of course but the only supported method to get at SQL Server's logical data and metadata structures (tables etc) is to use the SQL Server engine. Microsoft doesn't publish detailed specs for the file format.
这是我分离出数据的存储路径以下是连接方法:
class DBCon
{
public static SqlConnection GetConection()
{
return new SqlConnection("uid=sa;pwd=12345678;initial catalog=HR_Tianyu;data source=D:\\Personal\\TianyuHR\\TianyuHR\\Database;Connect Timeout=900");
} } private void toolStripButton1_Click(object sender, EventArgs e)
{
SqlConnection con = Class.DBCon.GetConection();
con.Open();
con.Close();
}
一点就挂起了,请大家帮忙看看
“Server=YourSQLServer”:使用名为“YourSQLServer”的服务器。他的别名为“Data Source”,“Address”,“Addr”。如果使用的是本地数据库且定义了实例名,则可以写为“Server=(local)\实例名”;如果是远程服务器,则将“(local)”替换为远程服务器的名称或IP地址。
“Connect Timeout=30”:连接超时时间为30秒。这里描述的应该是直接连接到现有的数据库服务器
我的需求是不用连接到数据库服务器,而是连接到一个已经被分离出来的一个数据库文件
method to get at SQL Server's logical data and metadata structures
(tables etc) is to use the SQL Server engine. Microsoft doesn't publish
detailed specs for the file format.
前台程序不可以直接访问MDF文件里面对应的数据库对象和数据
至少目前没有发现MS 提供接口直接访问MDF文件
E:\Program Files\凌鹏时代\凌鹏人力资源管理系统(标准版)\DatabaseTool.exe
这个DatabaseTool.exe
中有SqlServer数据库信息
服务器名称和IP
登录模式 1 Window的
2特定用户的
测试连接自动创建SqlServer数据库
使用SqlServer数据库文件附加1)假设客户没自行装MS SQL的服务和实例。该软件不可能运行在SQL模式 只能是Access模式。2)你可以在一台没装MS SQL服务的机器上,并且连接数据库模式选择MS SQL 。更改数据
主菜单 → 办公助手 → 通讯录 看看有什么结果通讯录对应 MS SQL里的表 dbo.通信录