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
Yuexuan 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.