I suggest you clarify your requirements/terminology
do you wish to IMPORT into your database from an excel file (or)
do you wish to EXPORT from your database to an excel file
(all depends on your point of view, but I find your question confusing)
(and it seems you're always asking for code, not doing any research and helping yourself... why is this ? - what is wrong with starting here
MySQL :: MySQL Connector/Net Developer Guide :: 1 Introduction to MySQL Connector/Net for example - you should see a 'tutorials' link on the left hand side of the page)
Furthermore, if you have installed the MySQL Connector/Net on your machine, which you will have to unless someone has done it already, it comes with samples