excel导入数据库代码问题
strSQL = "From OpenDataSource('Microsoft.Jet.OLEDB.4.0','DataSource=\""+strDataFilePath2+"";UserID=Admin;Password="";Extended properties= Excel4.0)[sheet1$];
总报错,怎么改? --------------------编程问答-------------------- 报什么错啊? --------------------编程问答-------------------- 字符文本中字符太多 --------------------编程问答-------------------- 参照这个格式撒:
string ConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Book3.xls;Extended Properties='Excel 8.0'";
--------------------编程问答-------------------- string ConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Book3.xls;Extended Properties='Excel 8.0'";
string query = "SELECT * FROM [Sheet1$]";
OleDbConnection odction = new OleDbConnection(ConnStr);
OleDbCommand oleCommand = new OleDbCommand(query, odction);
OleDbDataAdapter oleAdapter = new OleDbDataAdapter(oleCommand);
DataSet myDataSet = new DataSet();
oleAdapter.Fill(myDataSet, "[Sheet1$]");
补充:.NET技术 , ASP.NET