-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Dakshineswar
Message 4 in Discussion
// This is the connection string for to connect to an Excel Sheet.
�Provider=Microsoft.Jet.OLEDB.4.0;DataSource={PathToExcelFile};Extended
Properties=Excel 8.0� // This the way query an Excel sheet
// Construct Connection String
string connString =
�Provider=Microsoft.Jet.OLEDB.4.0;DataSource={PathToExcelFile};Extended
Properties=Excel 8.0�// Create Connection
OleDbConnection oleDbConn = new OleDbConnection(connString);
// Create Adapter
OleDbDataAdapter oleDbAdap = new OleDbDataAdapter("select * from [Sheet1$]",
oleDbConn);
// Sheet1 is the name of the sheet within the Excel Work book. Take care to append a $
behind the Sheet Name
// Create DataSet
DataSet objDataSet = new DataSet("Excel");
// Fill DataSet
oleDbAdap.Fill(objDataSet);
// Dispose and Close Objects
oleDbAdap.Dispose();
oleDbConn.Close();
Finally the objDataSet would contain the content from the Excel sheet.
DO take care that the Excel sheet contains data exactly in table format.
GEt back if reqd.
Kalyan D. bheri
[EMAIL PROTECTED]
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]