本文整理汇总了C#中Utility.getExcelDatatosql方法的典型用法代码示例。如果您正苦于以下问题:C# Utility.getExcelDatatosql方法的具体用法?C# Utility.getExcelDatatosql怎么用?C# Utility.getExcelDatatosql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility.getExcelDatatosql方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Importfile
public void Importfile(FileUpload fldReport, string tblName, string EDate)
{
string strPath = Convert.ToString(ConfigurationManager.AppSettings["WMSProjectName"].ToString());
if (fldReport.HasFile == true)
{
string FName = fldReport.PostedFile.FileName;
string str = FName.Substring(FName.LastIndexOf("\\") + 1);
object FileName = str;
strPath = Server.MapPath(strPath);
Path = strPath + "\\UploadFile\\" + str;
fldReport.SaveAs(Path);
}
else
{
//AlertMessage("No Such File Found !")
}
string sConnectionString = "";
string InitialCatalog = "";
//Dim dtApplicationSettings As DataTable = GetApplicationSettings()
DataTable dtExcelData = new DataTable();
string filePath = "";
if (fldReport.HasFile)
{
string FName = fldReport.PostedFile.FileName;
string str = FName.Substring(FName.LastIndexOf("\\") + 1);
FileName = str;
filePath = FName;
sConnectionString = ConfigurationManager.AppSettings["connectionString"];
Utility objUtility = new Utility();
int result = objUtility.getExcelDatatosql(Path, tblName, sConnectionString, EDate, null);
if (result == 1)
{
AlertMessage("File Imported successfully");
}
//Response.Redirect("/QAP/View/DataInput/BOMDisplay.aspx?WorkOrder=" + WorkOrder + "&LastPage=" + LastPage + "&test=" + test)
else
{
if (result == 3)
{
AlertMessage("File is already Imported");
}
else
{
AlertMessage("File is not in proper format");
}
}
}
else
{
AlertMessage("Pls Select file to be import!");
}
}