2022-11-23 焊接导入修改
This commit is contained in:
@@ -70,7 +70,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
return;
|
||||
}
|
||||
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
|
||||
if (IsXls != ".xls")
|
||||
if (IsXls != ".xlsx")
|
||||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
@@ -108,37 +108,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
private void ImportXlsToData(string fileName)
|
||||
{
|
||||
//支持.xls和.xlsx,即包括office2010等版本的 HDR=Yes代表第一行是标题,不是数据;
|
||||
//string cmdText = "Provider=Microsoft.ACE.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0; HDR=Yes; IMEX=1'";
|
||||
|
||||
////建立连接
|
||||
//OleDbConnection conn = new OleDbConnection(string.Format(cmdText, fileName));
|
||||
try
|
||||
try
|
||||
{
|
||||
//打开连接
|
||||
//if (conn.State == ConnectionState.Broken || conn.State == ConnectionState.Closed)
|
||||
//{
|
||||
// conn.Open();
|
||||
//}
|
||||
//OleDbDataAdapter oleAdMaster = null;
|
||||
//DataTable m_tableName = new DataTable();
|
||||
//DataSet ds = new DataSet();
|
||||
//m_tableName = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
|
||||
|
||||
//if (m_tableName != null && m_tableName.Rows.Count > 0)
|
||||
//{
|
||||
|
||||
// m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
|
||||
|
||||
//}
|
||||
//string sqlMaster;
|
||||
//sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
|
||||
//oleAdMaster = new OleDbDataAdapter(sqlMaster, conn);
|
||||
//oleAdMaster.Fill(ds, "m_tableName");
|
||||
//oleAdMaster.Dispose();
|
||||
//conn.Close();
|
||||
//conn.Dispose();
|
||||
string oleDBConnString = String.Empty;
|
||||
string oleDBConnString = String.Empty;
|
||||
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
|
||||
oleDBConnString += "Data Source=";
|
||||
oleDBConnString += fileName;
|
||||
|
||||
Reference in New Issue
Block a user