在盘下建立一个UDL连接文件test.udl
访问代码
string
strDBPath
=
@"
C:/test.udl
"
;
string
strSQL
=
"
select * from Employees
"
;
string
strConnection
=
"
File Name =
"
+
strDBPath;
OleDbConnection conn
=
new
OleDbConnection( strConnection );
OleDbDataAdapter da
=
new
OleDbDataAdapter( strSQL, conn );
DataTable dtEmployees
=
new
DataTable();
da.Fill( dtEmployees );
DataGrid1.DataSource
=
dtEmployees;
DataGrid1.DataBind();
1万+



被折叠的 条评论
为什么被折叠?



