TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ajay raju
NA
398
0
import excel data to datagrid?
Aug 27 2010 1:06 AM
Hi
A File upload area where the person can select an excel file to upload, a button to upload and then a datagrid which will display the uploaded data.
how to do this?
The details in this gridview are then saved to a database but before that they can be edited and some rows removed if necessary
i tried to display Excel to Datagrid but Error is occured when i Fill the data into dataset that Error message is
Cannot update. Database or object is read-only
. my code is:
Dim savePath As String = "~/ExcelFiles/"
Dim fileName As String = Server.HtmlEncode(fuImportContacts.FileName)
savePath = savePath & fileName
Dim strCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=Server.MapPath(savePath);" & "Extended Properties=Excel 8.0;"
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM [SHEET1$]", strCon)
da.TableMappings.Add("Table", "ExcelTest")
da.Fill(ds)
DataGrid1.DataSource = ds.Tables(0)
DataGrid1.DataBind()
please give a solution
Thanks
Reply
Answers (
1
)
Error : Object reference not set to an instance of an object.
Microsoft JScript runtime error: 'formValidator' is undefined