我开始用的是如下语句:
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=C:\BegASPNET\Ch12\northwind.mdb";
居然报错无法识别!然后用书上的标准格式才通过,
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";
strConnection += @"Data Source=C:\BegASPNET\Ch12\northwind.mdb";难道非要用下面的格式么,不一样么,非要换行难道?
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=C:\BegASPNET\Ch12\northwind.mdb";
居然报错无法识别!然后用书上的标准格式才通过,
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";
strConnection += @"Data Source=C:\BegASPNET\Ch12\northwind.mdb";难道非要用下面的格式么,不一样么,非要换行难道?
所以就是这样:
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=C:\\BegASPNET\Ch12\\northwind.mdb";
关于转义字符你可以去找找资料看看, 看了你就明白了.