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

excel file export to SQL server

hi guyz .. can anyone have an idea to export a excel file into sql server
table using web interface .

please give me an idea on this

thank u very much
san
auck


Nov 20 '05 #1
5 1179
Hi Sanju,

Have a look to this example, instead of the image you can also use an excel
file or whatever.

The only point is that it is visa versa on your question, this saves and
brings a file from a webserver to a dataset on the client.

I think that when you see it it is easy to translate to your problem.

Cor
\\\
Dim ds As New DataSet
Private abyt() As Byte
Private fo As New OpenFileDialog
Private sf As New SaveFileDialog
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
'Reading a picture from disk and put it in a bytearray
If fo.ShowDialog = DialogResult.OK Then
Dim fs As New IO.FileStream(fo.FileName, _
IO.FileMode.Open)
Dim br As New IO.BinaryReader(fs)
abyt = br.ReadBytes(CInt(fs.Length))
br.Close()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles Button2.Click
'writing a picture from a bytearray to disk
If sf.ShowDialog = DialogResult.OK Then
Dim fs As New IO.FileStream(sf.FileName, _
IO.FileMode.CreateNew)
Dim bw As New IO.BinaryWriter(fs)
bw.Write(abyt)
bw.Close()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles Button3.Click
'writing a bytearray to a webservice dataset
Dim ws As New localhost.DataBaseUpdate
ws.SetDataset(abyt)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button4.Click
'reading a picture from a webservice dataset
Dim ws As New localhost.DataBaseUpdate
abyt = ws.GetByte
Dim ms As New IO.MemoryStream(abyt)
End Sub
End Class
////
\\\\Webservice
<WebMethod()> _
Public Function GetByte() As Byte()
Dim ds As New DataSet
ds.ReadXml("C:\wsblob.xml")
Return CType(ds.Tables(0).Rows(0)(0), Byte())
End Function
<WebMethod()> _
Public Sub SetDataset(ByVal abyte As Byte())
Dim ds As New DataSet
ds.Tables.Add(New DataTable("Photo"))
ds.Tables(0).Columns.Add(New DataColumn("Sample"))
ds.Tables(0).Columns(0).DataType = GetType(System.Byte())
ds.Tables(0).Rows.Add(ds.Tables(0).NewRow)
ds.Tables(0).Rows(0)(0) = abyte
ds.WriteXml("C:\wsblob.xml", XmlWriteMode.WriteSchema)
End Sub
////

Cor
Nov 20 '05 #2
Hi San

You could create a datatable and browse all the cells of
the excel document and add the value in the datatable.

Finally you could add the datable to a dataset and use a
ASP.NET for the web interface.

Kind Regards
Jorge
-----Original Message-----
hi guyz .. can anyone have an idea to export a excel file into sql servertable using web interface .

please give me an idea on this

thank u very much
san
auck


.

Nov 20 '05 #3
Hi San

You could create a datatable and browse all the cells of
the excel document and add the value in the datatable.

Finally you could add the datable to a dataset and use a
ASP.NET for the web interface.

Kind Regards
Jorge
-----Original Message-----
hi guyz .. can anyone have an idea to export a excel file into sql servertable using web interface .

please give me an idea on this

thank u very much
san
auck


.

Nov 20 '05 #4
On Mon, 17 May 2004 18:54:13 +1200, "sanju" <sa**********@xtra.co.nz> wrote:

¤ hi guyz .. can anyone have an idea to export a excel file into sql server
¤ table using web interface .
¤
¤ please give me an idea on this
¤

See the following MS KB article:

HOW TO: Import Data into SQL Server from Excel
http://support.microsoft.com/default...b;en-us;321686
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #5


thank u cor.. i will try to work on this ..

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6

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

Similar topics

14
by: atse | last post by:
Hi experts, I retrieve data from the database and display on ASP, then I export these data to a file, like Excel (the best) or text file. Is it possible? I think it is possible, but how can I do...
8
by: DC Gringo | last post by:
I have a simple button that should open another window and export a datagrid to an Excel file. I'm getting: "Name 'window' is not declared." What do I need to declare or import? <INPUT...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
7
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
19
by: cj2 | last post by:
#1 Is there a quick way to export a datatable to an excel file? Or delimited file? #2 Where is the appropriate Microsoft monitored group to ask about writing reports in SQL Reporting services...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.