Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过Asp.net上载或导入Sql Server表中包含多个工作表的Excel工作表_Asp.net_Sql Server_Excel - Fatal编程技术网

通过Asp.net上载或导入Sql Server表中包含多个工作表的Excel工作表

通过Asp.net上载或导入Sql Server表中包含多个工作表的Excel工作表,asp.net,sql-server,excel,Asp.net,Sql Server,Excel,我有包含多个工作表的excel工作表,我想将此excel工作表上载/导入到表中。 例如: Excel表格格式: 第1页 拉姆|库马尔|贾因 拉德赫|莫汉|夏尔马 第2页 莫汉|库马尔|古普塔 钱德谢哈尔维尔马 我想在sql server表中上载/导入此excel。 表名:info 名|中名|姓链接: protected void btnUpload_Click(object sender, EventArgs e) { if (FileUpload1.HasFile)

我有包含多个工作表的excel工作表,我想将此excel工作表上载/导入到表中。

例如:
Excel表格格式:
第1页
拉姆|库马尔|贾因
拉德赫|莫汉|夏尔马

第2页
莫汉|库马尔|古普塔
钱德谢哈尔维尔马

我想在sql server表中上载/导入此excel。
表名:info
名|中名|姓

链接:

protected void btnUpload_Click(object sender, EventArgs e)

{

    if (FileUpload1.HasFile)

    {

        string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);

        string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName);

        string FolderPath = ConfigurationManager.AppSettings["FolderPath"];

        string FilePath = Server.MapPath(FolderPath + FileName);

        FileUpload1.SaveAs(FilePath);

        GetExcelSheets(FilePath, Extension, "Yes");

    }

}