I am using the following code to read an excel file and display the data on a data grid Code:
string strconn;
strconn = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source=c:\\\\test.xls;" +
"Extended Properties=Excel 8.0;";
OleDbConnection oConn = new OleDbConnection ();
oConn.ConnectionString = strconn;
oConn.Open ();
//create new OledbCommand to return data from worksheet
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", oConn);
DataSet ds = new DataSet ();
da.Fill(ds);
dataGrid1.DataSource = ds.Tables ;
dataGrid1.DataBindings ();
but when I run it, it gives me an error message - f:\c#\Entitlements Viewer\Form1.cs(306): 'System.Windows.Forms.Control.DataBindings' denotes a 'property' where a 'method' was expected