将Excel文件上传到SQL CE数据库 [英] Upload excel file to SQL CE database
本文介绍了将Excel文件上传到SQL CE数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
在我的应用程序中,我想保留一个按钮.单击此按钮后,将出现一个打开文件对话框,用户可以提供excel,pdf或word文件.然后,应将文件保存到数据库.对于我的应用程序,我使用sql ce db来保存数据.请告诉我该怎么做,并建议我是否应该使用sql db而不是sql ce db来上传文件.
这是Windows应用程序,而不是网页.
请有人帮忙!
Hi All
In my application i want to keep a button. On clicking this button an openfiledialog box appears and the user can provide excel, pdf or word files. The file then should be saved to the database. For my application I am using a sql ce db for saving data. Please tell me how to do this and please suggest if i should use sql db instead of sql ce db to upload files.
This is a windows application and not a web page.
Please someone help!!
推荐答案
用于上传excellsheet..u进行查询..在该查询上,您必须提及excel工作表的当前路径.
请参阅以下查询,如果这对您有帮助...
选择
*从openrowset("Microsoft.Jet.OLEDB.4.0","Excel 8.0; Database = excellsheet路径,进入表名,从* Sheetname
for uploading an excellsheet..u neet a query..and on that query u have to mension the current path of excel sheet..
see following query if this helpful you...
select
* Into Tablename from openrowset (''Microsoft.Jet.OLEDB.4.0'' ,''Excel 8.0;Database=excellsheet path,Select * from [Sheetname
)中选择*
希望这对您有用...
)
hope this useful to u...
这篇关于将Excel文件上传到SQL CE数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文