•
•
•
•
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
![]() |
•
•
Join Date: Jan 2008
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
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
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
•
•
Join Date: May 2005
Posts: 494
Reputation:
Rep Power: 4
Solved Threads: 18
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?
Then have your form just hit that url and pass it's variables to it and process the file.
Simple enough right?
•
•
Join Date: May 2005
Posts: 494
Reputation:
Rep Power: 4
Solved Threads: 18
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.
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'
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
access advice avatar backup broadband business code combo crime daniweb data data protection data transfer database design drive dropdownlist encryption europe forensic forensics fun hacker hard hardware help hitachi hp ibm industrial espionage it linux medicine module net news normalization privacy protection reuse security server sql storage survey terabyte tutorials and more web wikipedia you tried to assign the null value to a variable that is not a variant data type
- Database Design Question (Database Design)
- Varchar field as foreign reference (MySQL)
- how do i import data from a csv file to my mysql database (MySQL)
- Error message while importing data to Excel from the MySQL db (MySQL)
Other Threads in the ASP.NET Forum
- Previous Thread: Asp.net and linux mail server
- Next Thread: Multiple DDLs populating different fields in a form


Linear Mode