I am trying to read excel file from my asp.net page
i tried this code
dim con as oledbconnection
dim cmd as oledbcommand
dim str = "provider=microsoft.jet.oledb.4.0;data source= " & server.mappath("..\book1.xls") & ";" & "extended properties= excel 8.0"
con=new oledbconnection(str)
con.open
i have given range name in .xls sheet as book_range
cmd=new oledbcommand("select * from book_range",con)
datagrid1.datasource=cmd.executenonquery
the connection gets open but when it executes command object it gives me
error saying 'the file may be in use '
so please give me solution for this as early possible
and also i want to know can i read excel file using DSN if so pls give code
thanks
aparnarao