日期:2014-05-17 浏览次数:20427 次
string fileName = FileUpload1.FileName; string fPath = Server.MapPath("\\") + "CardFile\\";//上传到服务器的文件夹路径 if (Directory.Exists(fPath) == false) { Directory.CreateDirectory(fPath); } string filePath = fPath + fileName;//绝对路径 FileUpload1.SaveAs(filePath);//上传至服务器 string strConn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='text;HDR=Yes;FMT=Delimited';Data Source=" + fPath); OleDbConnection conn = new OleDbConnection(strConn); DataTable dt = new DataTable(); string sqlStr = "select * from " + fileName; try { if (conn.State == ConnectionState.Closed) conn.Open(); OleDbDataAdapter dr = new OleDbDataAdapter(sqlStr, conn); DataSet ds = new DataSet(); dr.Fill(ds, "mytable"); dt = ds.Tables["mytable"]; } catch { } finally { conn.Close(); } return dt;
var number = "1.203E16"; decimal decstr = decimal.Parse(number.ToString(), System.Globalization.NumberStyles.Any);
------解决方案--------------------