上载Excel文件
问题描述:
大家好,
这是一个问题.我想通过c#将excel文件上传到sql服务器.我希望该表的配置应来自xml文件.
怎么做.任何欢迎使用的示例代码
在此先感谢
sanjeev singh
Hello All,
Here is one problem. I want to upload an excel file to the Sql server through c#. i want that configuration for the table should come from xml file.
How to do that. any sample code most welcome
Thanks in advance
sanjeev singh
答
您可以像输入其他任何文件一样完全上传它-通过具有file
类型输入和方法"POST"的表单.
在服务器端,您可以获取此临时Excel文件,然后使用表和Microsoft Office互操作性将其重新加工为HTML.从这里开始: http://msdn.microsoft.com/en-us/library/dd264733.aspx [ ^ ].
有关使用Excel的信息,请参见 http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.11%29.aspx [
You can upload it exactly like any other file — by a form with the input of thefile
type and the method "POST".
On server side, you can take this temporary Excel file and re-work in into HTML using tables and Microsoft Office interoperability. Start from here: http://msdn.microsoft.com/en-us/library/dd264733.aspx[^].
For working with Excel, see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.11%29.aspx[^].—SA