使用Excel OleDb获取工作表名称IN SHEET ORDER(Using Excel OleDb to get sheet names IN SHEET ORDER)
我正在使用OleDb从excel工作簿中读取许多工作表。
我需要阅读表格名称,但是我们需要按照它们在电子表格中定义的顺序; 所以如果我有一个这样的文件;
|_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| \__GERMANY__/\__UK__/\__IRELAND__/
然后我需要得到字典
1="GERMANY", 2="UK", 3="IRELAND"
我试过使用
OleDbConnection.GetOleDbSchemaTable()
,这给我的名字列表,但它按字母排序它们。 阿尔法排序意味着我不知道特定名称对应的哪个表格编号。 所以我得到GERMANY, IRELAND, UK
这改变了
UK
和IRELAND
的秩序。我需要排序的原因是我必须让用户按名称或索引选择一系列数据; 他们可以要求“从德国到爱尔兰的所有数据”或“从表格1到表格3的数据”。
任何想法将不胜感激。
如果我可以使用办公室互操作课程,这很简单。 不幸的是,我不能因为互操作类在非交互式环境(如Windows服务和ASP.NET站点)中不能可靠地运行,所以我需要使用OLEDB。
I'm using OleDb to read from an excel workbook with many sheets.
I need to read the sheet names, but I need them in the order they are defined in the spreadsheet; so If I have a file that looks like this;
|_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| \__GERMANY__/\__UK__/\__IRELAND__/
Then I need to get the dictionary
1="GERMANY", 2="UK", 3="IRELAND"
I've tried using
OleDbConnection.GetOleDbSchemaTable()
, and that gives me the list of names, but it alphabetically sorts them. The alpha-sort means I don't know which sheet number a particular name corresponds to. So I get;GERMANY, IRELAND, UK
which has changed the order of
UK
andIRELAND
.The reason I need it to be sorted is that I have to let the user choose a range of data by name or index; they can ask for 'all the data from GERMANY to IRELAND' or 'data from sheet 1 to sheet 3'.
Any ideas would be greatly appreciated.
if I could use the office interop classes, this would be straightforward. Unfortunately, I can't because the interop classes don't work reliably in non-interactive environments such as windows services and ASP.NET sites, so I needed to use OLEDB.
原文:https://stackoverflow.com/questions/1164698
最满意答案
不,你不能这样做 。
开发人员菜单位于客户端,由用户的浏览器提供。
浏览器开发人员也应该与服务器端的数据库代码无关 ,如果有的话,您需要一些maaaaa重组。
No you cannot do this.
The developer menu is on the client side and is provided by the user's browser.
Also the browser developer should have nothing to do with your server side database code, and if it does, you need some maaaaaajor restructuring.
相关问答
更多-
目前不支持。 请参阅允许将开发人员工具(F12)附加到选项卡框架 。 Currently not supported. See Allow attaching developer tools (F12) to the tab frame.
-
区别在于用户代理字符串。 “IE7”完全模拟IE7的用户代理字符串,显示MSIE 7.0。 “IE8”完全使用IE8的本地用户代理字符串,显示MSIE 8.0以及Trident / 4.0,它是IE8中使用的Trident布局引擎的版本。 IE8兼容性使用浏览器的本地用户代理字符串,但将“8.0”更改为“7.0”。 由于Trident在IE7之前没有版本号,所以IE7字符串不显示“Trident / xx”。 因此,对于MSIE 7.0用户代理字符串,如果“Trident / 4.0”也存在,则您知道它是在 ...
-
Facebook如何禁用浏览器的集成开发工具?(How does Facebook disable the browser's integrated Developer Tools?)[2022-05-08]
我是Facebook的安全工程师,这是我的错。 我们正在测试一些用户,以查看是否可以减慢一些用户被欺骗(恶意)JavaScript代码进入浏览器控制台的攻击。 只是要明确:试图阻止黑客客户端是一个坏主意 ; 这是为了防止具体的社会工程攻击 。 如果你最终在测试组中,对此感到懊恼,抱歉。 我试图让旧的选择退出页面(现在的帮助页面 )尽可能简单,同时仍然是可怕的,至少阻止一些受害者。 实际代码非常类似于@ joeldixon66的链接 ; 我们有点复杂,没有什么好的理由。 Chrome包装所有控制台代码 wit ... -
你不再需要做任何事情。 对于较旧的反应版本,主要要求是window.React设置。 如果您正在使用模块系统: if (typeof window !== 'undefined') { window.React = React; } 这通常应该在您的主源文件中完成。 You no longer need to do anything. For older react versions, the main requirement is that window.React is set. If you ...
-
Chrome 46或更新版本 单击垂直省略号按钮(⋮),然后选择所需的对接选项。 Chrome 45或更旧 长按住右上角的dock图标。 它弹出一个选项来改变对接 要更改HTML和CSS面板之间的拆分,请在DevTools中进行设置(F1)>常规>外观>面板布局。 Chrome 46 or newer Click the vertical ellipsis button ( ⋮ ) then choose the desired docking option. Chrome 45 or older Long ...
-
在Chrome中,当您转到开发工具中的“网络”选项卡,然后单击WebSocket连接时,您可以通过在显示的WebSocket数据中从“标题”切换到“框架”来查看交换的数据。 In Chrome, when you go to the "Network" tab in the dev tools and then click on a WebSocket connection, you can view the exchanged data by switching from "Headers" to "Fr ...
-
不,你不能这样做 。 开发人员菜单位于客户端,由用户的浏览器提供。 浏览器开发人员也应该与服务器端的数据库代码无关 ,如果有的话,您需要一些maaaaa重组。 No you cannot do this. The developer menu is on the client side and is provided by the user's browser. Also the browser developer should have nothing to do with your server sid ...
-
您可以将事件绑定到页面上的所有元素并检查光标样式: var oldCursorStyle = 'auto'; var myChangeFunction = function(cursorStyle) { console.info('It has changed to: ' + cursorStyle); }; $('*').mouseenter(function(){ var currentCursorStyle = $(this).css('cursor'); if (oldCur ...
-
不,从Chrome 32.0.1673.0开始,无法禁用引用/大括号自动插入和/或代码完成。 请随时在crbug.com上为DevTools提交一个错误,我们会修复它。 Thanks (perhaps) to the bug that was filed, this is now a feature in Google Chrome. To disable autocomplete in Chrome Dev Tools: Open Dev Tools if it's not open already. O ...
-
在浏览器开发工具控制台中解析当前页面的json(Parse json from the current page in browser developer tools console)[2022-12-05]
在Chrome中,我打开了上面的链接并转到Chrome的开发人员工具(F12),然后在控制台中输入以下命令... JSON.parse(document.body.textContent) 它很好地返回了一个对象表示。 从Javascript中操作和使用对象是一件容易的事。 例如... JSON.parse(document.body.textContent).movies.length ...返回2。 In Chrome, I opened the link above and went to Chr ...