-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix asp.net webform gridview datasource can't use miniexcel queryasda…
…tatable #223
- Loading branch information
1 parent
8f3d521
commit 64071b1
Showing
19 changed files
with
451 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.31205.134 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebFormTest", "WebFormTest\WebFormTest.csproj", "{47EE42A4-E8DA-4355-A910-147E725C618B}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiniExcelLibs", "..\..\src\MiniExcel\MiniExcelLibs.csproj", "{AC525AB6-2A1A-4935-934B-322C92FC4A94}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{47EE42A4-E8DA-4355-A910-147E725C618B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{47EE42A4-E8DA-4355-A910-147E725C618B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{47EE42A4-E8DA-4355-A910-147E725C618B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{47EE42A4-E8DA-4355-A910-147E725C618B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{AC525AB6-2A1A-4935-934B-322C92FC4A94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{AC525AB6-2A1A-4935-934B-322C92FC4A94}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{AC525AB6-2A1A-4935-934B-322C92FC4A94}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{AC525AB6-2A1A-4935-934B-322C92FC4A94}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {27C1DF70-1D3C-4D03-BC5B-5A8E66C85879} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%@ Application Codebehind="Global.asax.cs" Inherits="WebFormTest.Global" Language="C#" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Security; | ||
using System.Web.SessionState; | ||
|
||
namespace WebFormTest | ||
{ | ||
public class Global : System.Web.HttpApplication | ||
{ | ||
protected void Application_Start(object sender, EventArgs e) | ||
{ | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
tests/MiniExcel.Tests.WebForm/WebFormTest/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("WebFormTest")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("WebFormTest")] | ||
[assembly: AssemblyCopyright("Copyright © 2021")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("47ee42a4-e8da-4355-a910-147e725c618b")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
17 changes: 17 additions & 0 deletions
17
tests/MiniExcel.Tests.WebForm/WebFormTest/TestIssue223.aspx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestIssue223.aspx.cs" Inherits="WebFormTest.WebForm1" %> | ||
|
||
<!DOCTYPE html> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head runat="server"> | ||
<title></title> | ||
</head> | ||
<body> | ||
<form id="form1" runat="server"> | ||
<div> | ||
<asp:GridView ID="GridView1" runat="server" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"> | ||
</asp:GridView> | ||
</div> | ||
</form> | ||
</body> | ||
</html> |
26 changes: 26 additions & 0 deletions
26
tests/MiniExcel.Tests.WebForm/WebFormTest/TestIssue223.aspx.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.UI; | ||
using System.Web.UI.WebControls; | ||
|
||
namespace WebFormTest | ||
{ | ||
public partial class WebForm1 : System.Web.UI.Page | ||
{ | ||
protected void Page_Load(object sender, EventArgs e) | ||
{ | ||
var path = HttpContext.Current.ApplicationInstance.Server.MapPath("~/TestIssue223.xlsx"); | ||
var dt = MiniExcelLibs.MiniExcel.QueryAsDataTable(path); | ||
this.GridView1.DataSource = dt; | ||
this.GridView1.DataBind(); | ||
} | ||
|
||
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
tests/MiniExcel.Tests.WebForm/WebFormTest/TestIssue223.aspx.designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
30 changes: 30 additions & 0 deletions
30
tests/MiniExcel.Tests.WebForm/WebFormTest/Web.Debug.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- For more information on using web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=125889 --> | ||
|
||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | ||
<!-- | ||
In the example below, the "SetAttributes" transform will change the value of | ||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator | ||
finds an attribute "name" that has a value of "MyDB". | ||
<connectionStrings> | ||
<add name="MyDB" | ||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" | ||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | ||
</connectionStrings> | ||
--> | ||
<system.web> | ||
<!-- | ||
In the example below, the "Replace" transform will replace the entire | ||
<customErrors> section of your web.config file. | ||
Note that because there is only one customErrors section under the | ||
<system.web> node, there is no need to use the "xdt:Locator" attribute. | ||
<customErrors defaultRedirect="GenericError.htm" | ||
mode="RemoteOnly" xdt:Transform="Replace"> | ||
<error statusCode="500" redirect="InternalError.htm"/> | ||
</customErrors> | ||
--> | ||
</system.web> | ||
</configuration> |
31 changes: 31 additions & 0 deletions
31
tests/MiniExcel.Tests.WebForm/WebFormTest/Web.Release.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- For more information on using web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=125889 --> | ||
|
||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | ||
<!-- | ||
In the example below, the "SetAttributes" transform will change the value of | ||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator | ||
finds an attribute "name" that has a value of "MyDB". | ||
<connectionStrings> | ||
<add name="MyDB" | ||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" | ||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | ||
</connectionStrings> | ||
--> | ||
<system.web> | ||
<compilation xdt:Transform="RemoveAttributes(debug)" /> | ||
<!-- | ||
In the example below, the "Replace" transform will replace the entire | ||
<customErrors> section of your web.config file. | ||
Note that because there is only one customErrors section under the | ||
<system.web> node, there is no need to use the "xdt:Locator" attribute. | ||
<customErrors defaultRedirect="GenericError.htm" | ||
mode="RemoteOnly" xdt:Transform="Replace"> | ||
<error statusCode="500" redirect="InternalError.htm"/> | ||
</customErrors> | ||
--> | ||
</system.web> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
For more information on how to configure your ASP.NET application, please visit | ||
https://go.microsoft.com/fwlink/?LinkId=169433 | ||
--> | ||
<configuration> | ||
<system.web> | ||
<compilation debug="true" targetFramework="4.5.1" /> | ||
<httpRuntime targetFramework="4.5.1" /> | ||
</system.web> | ||
<system.codedom> | ||
<compilers> | ||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /> | ||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" /> | ||
</compilers> | ||
</system.codedom> | ||
</configuration> |
Oops, something went wrong.