首页上一页 1 下一页尾页 3 条记录 1/1页
求助
发表在C#图书答疑
2010-01-25
是否精华
是
否
版块置顶:
是
否
可以详细的解释一下以下代码吗?特别是Data Source后面的格式
public OleDbConnection getCon()
{
string strDPath = Application.StartupPath;
string strDataSource = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ strDPath.Substring(0, strDPath.LastIndexOf("\\")).Substring(0, strDPath.Substring(0, strDPath.LastIndexOf("\\")).LastIndexOf("\\")) + "\\DataBase\\db_VWMS.mdb";
OleDbConnection oledbCon = new OleDbConnection(strDataSource);
return oledbCon;
}
public OleDbConnection getCon()
{
string strDPath = Application.StartupPath;
string strDataSource = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ strDPath.Substring(0, strDPath.LastIndexOf("\\")).Substring(0, strDPath.Substring(0, strDPath.LastIndexOf("\\")).LastIndexOf("\\")) + "\\DataBase\\db_VWMS.mdb";
OleDbConnection oledbCon = new OleDbConnection(strDataSource);
return oledbCon;
}