473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

From excel file into MS SQL server

I need to find a way to upload an Excel file into an MS SQL database
using a web control front end. I have my ASP.Net control (using C#)
uploading a file to a directory, but the server people now tell me that
I cannot have a writeable area for the web and have a DTS see it as this
is too much of a security risk. So, I need a way to read the file
directly into the database. I've no idea how to do this. Does anyone
have ideas? I know loading MS Office into the web server is out of the
question. The webserver and database server are not the same physical
machine.

Thanks.

Jul 23 '05 #1
6 2035
Yes you can upload any file directly into SQL Server.
Here's an example:
http://SteveOrr.net/Articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"no one" <no***@yahoo.com> wrote in message
news:41***************@yahoo.com...
I need to find a way to upload an Excel file into an MS SQL database
using a web control front end. I have my ASP.Net control (using C#)
uploading a file to a directory, but the server people now tell me that
I cannot have a writeable area for the web and have a DTS see it as this
is too much of a security risk. So, I need a way to read the file
directly into the database. I've no idea how to do this. Does anyone
have ideas? I know loading MS Office into the web server is out of the
question. The webserver and database server are not the same physical
machine.

Thanks.

Jul 23 '05 #2
Thanks for the link, but this is not what I want to do. I want to put the
data from the file into a table, not the file itself.

"Steve C. Orr [MVP, MCSD]" wrote:
Yes you can upload any file directly into SQL Server.
Here's an example:
http://SteveOrr.net/Articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"no one" <no***@yahoo.com> wrote in message
news:41***************@yahoo.com...
I need to find a way to upload an Excel file into an MS SQL database
using a web control front end. I have my ASP.Net control (using C#)
uploading a file to a directory, but the server people now tell me that
I cannot have a writeable area for the web and have a DTS see it as this
is too much of a security risk. So, I need a way to read the file
directly into the database. I've no idea how to do this. Does anyone
have ideas? I know loading MS Office into the web server is out of the
question. The webserver and database server are not the same physical
machine.

Thanks.


Jul 23 '05 #3

"no one" <no***@yahoo.com> wrote in message
news:41***************@yahoo.com...
Thanks for the link, but this is not what I want to do. I want to put the
data from the file into a table, not the file itself.

"Steve C. Orr [MVP, MCSD]" wrote:


<snip>

Have a look at DTS - it can load directly from Excel (or most other things)
to MSSQL, and you can change the source and destination connections at
runtime. This link discusses executing a package from ASP:

http://www.sqldts.com/default.aspx?207

Otherwise, you can parse the file and generate your own INSERT statements
(slow), or convert it to a flat text file and then use bcp.exe or BULK
INSERT to load the data.

Simon

Jul 23 '05 #4
Oh, I now see your dilemma. That's fairly complex functionality.
My only idea is this 3rd party product that can open an excel file from a
memory stream and will allow you to extract data from it:
http://www.SteveOrr.net/Reviews/AsposeWord.aspx
http://www.aspose.com/Products/Aspose.Excel/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"no one" <no***@yahoo.com> wrote in message
news:41***************@yahoo.com...
Thanks for the link, but this is not what I want to do. I want to put the
data from the file into a table, not the file itself.

"Steve C. Orr [MVP, MCSD]" wrote:
Yes you can upload any file directly into SQL Server.
Here's an example:
http://SteveOrr.net/Articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"no one" <no***@yahoo.com> wrote in message
news:41***************@yahoo.com...
>I need to find a way to upload an Excel file into an MS SQL database
> using a web control front end. I have my ASP.Net control (using C#)
> uploading a file to a directory, but the server people now tell me that
> I cannot have a writeable area for the web and have a DTS see it as
> this
> is too much of a security risk. So, I need a way to read the file
> directly into the database. I've no idea how to do this. Does anyone
> have ideas? I know loading MS Office into the web server is out of the
> question. The webserver and database server are not the same physical
> machine.
>
> Thanks.
>

Jul 23 '05 #5
DTS has been mentioned.
3rd parties that also do the job: SQLWays , DBUnit.

Jul 23 '05 #6
"no one" <no***@yahoo.com> wrote in message
news:41***************@yahoo.com...
I need to find a way to upload an Excel file into an MS SQL database
using a web control front end. I have my ASP.Net control (using C#)
uploading a file to a directory, but the server people now tell me that
I cannot have a writeable area for the web and have a DTS see it as this
is too much of a security risk. So, I need a way to read the file
directly into the database. I've no idea how to do this. Does anyone
have ideas? I know loading MS Office into the web server is out of the
question. The webserver and database server are not the same physical
machine.

Thanks.


Did you know cross-posting is one of the things some ISPs pick to identify
spam?
This'd be a whole lot easier if your app was windows rather than web.
Coz you don't have any way to be running c# on our client machine.

Is this really an extranet app?
I'd be concerned about who's loading what out a spreadsheet onto my database
server.
It does sound like a good way to open up a hole for hackers to walk in
through.
Uploading excel spreadsheets is also a good way to get a big heap of bad
data into a system.

Anyhow, it piqued my interest so I did a search on "javascript excel"
Here's an interesting page I found.
http://www.planet-source-code.com/vb...=2180&lngWId=2

Some gotchas but maybe they're not a problem for you.

--
Regards,
Andy O'Neill
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alberto Vera | last post by:
Hello: Is it possible to get a row from a text-file? This text-file is located in a web page. And a value from an excel located in a web-server? (Sheet1!cell A1) Regards
2
by: Alvin Bruney | last post by:
anybody know how to launch desktop excel from a webpage and feed it either a dataset or a file? i've got MS sample code but it aint compiling with the office 10 library. i wonder if they changed...
0
by: Rich Wallace | last post by:
Hello all, Looking for suggestions and tips if possible. I have an application running on a file server that utilizes the FileSystemWatcher to trap when any Excel files are saved by a user. I...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
2
by: Mad Scientist Jr | last post by:
>From an asp.net web page I want the user to open the results of a SQL query in Excel, as automatically as possible (ie not having to loop through columns, rows, in code). For this,...
8
by: KeithChang | last post by:
Hi, I'm building a web application in VB.NET 1.1 where users will upload Excel files at this webpage and the web application will transfer the data from the uploaded Excel file into MS SQL 2000....
1
by: =?Utf-8?B?TGFtaXM=?= | last post by:
HI, I am doing an aspx application and need to let my users be able to edit the information in my database by the page. My first Idea was to let them export the information to an excel file at...
1
roswara
by: roswara | last post by:
Dear all, Currently, I am working on a project to make a web-based application using ASP 2.0 and C#. This application will ask user to input for an excel file which has graphs in it. Then the...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.