Uploading excel data to sql database in asp.net application


What is the efficient way to upload excel data to sql database?

excel file consists of 4000 rows..so i need to save these records to sql database in web application,i know only by creating ODBC connection i.e

_path = @Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq= + _path;
OdbcConnection _xlsConn = new OdbcConnection(_path);
OdbcCommand _xlsSelSht = new OdbcCommand("Select " + columns + " FROM [" + _sheet + "$]", _xlsConn);
OdbcDataReader _xlsReader = _xlsSelSht.ExecuteReader();
while (_xlsReader.Read()){.....}

Is this is efficient way ? keeping in mind speed because huge data needs to upload...



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion