日期:2014-05-17 浏览次数:20445 次
public static bool UpdateData(string Filepath)
{
DataSet ds = new DataSet();
OleDbConnection con;
OleDbDataAdapter da;
try
{
string strExtName = Filepath.Substring(Filepath.Length - 4).ToLower();
string connStr = "";
switch (strExtName)
{
case ".xls":
{
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;data source=" + Filepath + "; Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'";
break;
}
case "xlsx":
{
connStr = "