473,395 Members | 1,637 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,395 software developers and data experts.

Upload Excel Sheet -> Import to SS 2005

Hello, I'm trying to create an application for a friend's business. He
gets Excel Spreadsheets from a lab - he would like for his partners to
be able to Upload this Sheet to a website, and have the page import the
sheet and add the data to his existing SS 2005 database.

Is this possible, and where should I begin looking? Thanks,

Nov 7 '06 #1
3 3258
Sounds all very doable, depends I suppose on the content of the spreadsheet
as to how difficult it might be.

You can use the FileUpload control to upload the file to the server, once on
the server you can use ADO.NET to access the spreadsheet and enter the data
into the database. You will have to search for the necessary connection
string for accessing an Excel document as I have never tried it.
"Kbalz" <kb******@edge-sweets.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hello, I'm trying to create an application for a friend's business. He
gets Excel Spreadsheets from a lab - he would like for his partners to
be able to Upload this Sheet to a website, and have the page import the
sheet and add the data to his existing SS 2005 database.

Is this possible, and where should I begin looking? Thanks,

Nov 7 '06 #2
Thanks for the Reply Joseph - I will look into those steps. The Excel
Sheet is always the same columns & types so that part should be
regular. I'll reply in a few days when I have some code to work with -
thx a bunch,

Kurt

JosephByrns wrote:
Sounds all very doable, depends I suppose on the content of the spreadsheet
as to how difficult it might be.

You can use the FileUpload control to upload the file to the server, once on
the server you can use ADO.NET to access the spreadsheet and enter the data
into the database. You will have to search for the necessary connection
string for accessing an Excel document as I have never tried it.
"Kbalz" <kb******@edge-sweets.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hello, I'm trying to create an application for a friend's business. He
gets Excel Spreadsheets from a lab - he would like for his partners to
be able to Upload this Sheet to a website, and have the page import the
sheet and add the data to his existing SS 2005 database.

Is this possible, and where should I begin looking? Thanks,
Nov 7 '06 #3
The way i do it is upload the excel file, i then run an application that
extracts the data to an xml file (there are samples on codeproject, don't use
the saveas in excel to create the xml)
Then i run an sp like:
CREATE PROCEDURE [dbo].[usp_BulkXmlInsert]
AS
DECLARE @c xml
BEGIN
SELECT @c = BulkColumn FROM OPENROWSET(BULK
'C:\Inetpub\wwwroot\uploads\Templates\XMLUpload.xm l', SINGLE_BLOB) AS A
INSERT INTO thetable SELECT T.C.value('F1[1]', 'nVARCHAR(50)'),
T.C.value('F2[1]', 'nVARCHAR(50)'),
T.C.value('F3[1]', 'nVARCHAR(50)'),
T.C.value('F4[1]', 'nVARCHAR(50)'),
T.C.value('F5[1]', 'nVARCHAR(150)'),
T.C.value('F6[1]', 'nVARCHAR(250)'),
T.C.value('F7[1]', 'nVARCHAR(50)'),
T.C.value('F8[1]', 'nVARCHAR(50)'),
T.C.value('F9[1]', 'nVARCHAR(50)'),
T.C.value('F10[1]', 'nVARCHAR(50)'),
T.C.value('F11[1]', 'nVARCHAR(50)')
FROM @c.nodes('NewDataSet/Import_x007C_A3_x003A_J9815') AS T(C)
END

note Import_x007C_A3_x003A_J9815' is the name of the Sheet and a node in the
xml file

Rod

"Kbalz" wrote:
Hello, I'm trying to create an application for a friend's business. He
gets Excel Spreadsheets from a lab - he would like for his partners to
be able to Upload this Sheet to a website, and have the page import the
sheet and add the data to his existing SS 2005 database.

Is this possible, and where should I begin looking? Thanks,

Nov 8 '06 #4

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

Similar topics

3
by: Prakash | last post by:
Hi, We face problems uploading excel (with macros) documents using HTML File Upload. The file contents are corrupted while viewing the same. However, we are able to upload excel (w/o. macros)...
2
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into specific library in AS400 DB2 using AS400...
12
by: elziko | last post by:
I'm using late binding (I must) to automate Excel. My code opens Excel after createing and poulating some sheets. My problem is that when the user finally decides to close Excel its process is...
3
by: | last post by:
Hello, I have a routine in my Windows application that exports the contents of a datagrid to Excel. It is modeled closely after the HowTo example on MSDN: http://tinyurl.com/5g2jm. Depending...
3
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel...
3
by: pleaseexplaintome_2 | last post by:
using the code below (some parts not included), I create a new excel workbook with spreadheets. I then want to delete a spreadsheet, but a reference remains open and excel stays in task manager...
13
by: chuckie_9497 | last post by:
hello all you gurus. I am struggling with releasing com objects. I have isolated the problem to the code below. Objects are released and the process ends until I use "int k = sheet.Count;" Then...
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...
5
by: priyammaheshwari | last post by:
Hi all, I have a MS Access database in which requests made by people is stored,but a coulmn for cost is left empty which is suppose to be populated by the administrator.Now the administrator wants...
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.