无法连接到.sdf
(SQL Server CE)数据库。
此代码给出了错误
路径无效。检查数据库的目录。
代码:
@using System;
@using System.IO;
@using System.Text;
@using System.Data;
@using System.Data.SqlServerCe;
@using System.Collections;
@using System.Data.Common;
@{
SqlCeConnection connection = new SqlCeConnection("Data Source=C:\\Users\\Blahblah\\Documents\\My Web Sites\\App_Data\\Pagelist.sdf;Persist Security Info=False;");
SqlCeCommand command = new SqlCeCommand("SELECT * FROM pageinfo WHERE PageID=1",connection);
connection.Open();
///etc. etc...
connection.Close();
}