User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,958 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,943 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2194 | Replies: 4
Reply
Join Date: Jan 2008
Posts: 13
Reputation: Yuexuan is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Yuexuan Yuexuan is offline Offline
Newbie Poster

Help How to import excel file data to mysql database

  #1  
Feb 14th, 2008
How to import excel file data to mysql database
here is my uploading file coding
how to use my uploaded excel file to get it data and store it at database
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim filepath As String = Server.MapPath("Files/")
Dim filename As String = FileUpload1.FileName
'Check if user has selected a file.
If FileUpload1.HasFile Then
If FileUpload1.PostedFile.ContentType = "application/vnd.ms-excel" Then
Try
'save the file at location path
FileUpload1.SaveAs(filepath & filename)
Catch ex As Exception
Label1.Text = "Error:" & ex.Message.ToString()
End Try
Else
Label1.Text = "You only can select .csv file "
Label2.Text = "Please select .csv file again"
End If
Else
Label1.Text = "You have not specified a file."
End If
End Sub
How to use the get data from excel file and store it to database thanks
helpful will appreciate
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2005
Posts: 494
Reputation: techniner is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 18
techniner techniner is offline Offline
Posting Pro in Training

Re: How to import excel file data to mysql database

  #2  
Feb 14th, 2008
A simple way to do this would be to write a PHP script that imports the data.

Then have your form just hit that url and pass it's variables to it and process the file.

Simple enough right?
Did my post help?
Visit Little Jon's Web Portal


Generate Traffic with Maximum Traffic Software
Reply With Quote  
Join Date: Jan 2008
Posts: 13
Reputation: Yuexuan is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Yuexuan Yuexuan is offline Offline
Newbie Poster

Help Re: How to import excel file data to mysql database

  #3  
Feb 14th, 2008
I only allow to use asp.net 2.0 by using vb.net language to write
I want is upload the excel file then get the data at excel file and store the data to database
thanks
Reply With Quote  
Join Date: May 2005
Posts: 494
Reputation: techniner is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 18
techniner techniner is offline Offline
Posting Pro in Training

Re: How to import excel file data to mysql database

  #4  
Feb 14th, 2008
Again I would still just use a LOADFILE call.

Either via ASP.NET or PHP or however else you want to do it.

LOADFILE is mysql based command and can be built into your query.

LOAD DATA LOCAL INFILE 'yourfile.txt' INTO TABLE `yourtable` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
Did my post help?
Visit Little Jon's Web Portal


Generate Traffic with Maximum Traffic Software
Reply With Quote  
Join Date: Jan 2008
Posts: 13
Reputation: Yuexuan is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Yuexuan Yuexuan is offline Offline
Newbie Poster

Re: How to import excel file data to mysql database

  #5  
Feb 18th, 2008
How to use it ?Can u explain specific clearly
because i am new in asp.net
thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 9:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC