public Class Form1
inherits System.Windows.Forms.Form
for button1_click
dim myconnection as system.data.oledb.oledb.oledbconnection
try
dim dtset as system.data.dataset
dim my command as system.data.oledb.oledbdataadapter
myconnection=new _
system.data.oledb.oledbconnection("provider=micros oft.jet.oledb.4.0;" & _
"data sourc=c:\zpp.xls;"Extended Properties=Excel8.0;"
mycommand=new system.data.oledb.oledbdataadapter( _
"select * from[sheet1$]",myconnection)
mycommand.tablemappings.add("table","table1")
dtset=new system.data.dataset
mycommand.file(dtset)
datagrid1.datasource=dtset.tables(0)
myconnection.dispose()
catch ex as Exception
myconnection.close
end try
end sub
end class