ADO.NET
Hi guys,
I am trying to populate a datagrid using a data adapter. When ever I execute the file this is the error I get: -
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: Format of the initialization string does not conform to specification starting at index 0.
This is my Code: -
private void button1_Click(object sender, System.EventArgs e)
{
string source = "Provider = Microsoft.Jet.OleDb.4.0; data source=D:\\House or Home Site\\House.mdb;";
string Select = "SELECT * FROM Houses";
OleDbConnection objConnection = new OleDbConnection(Select);
OleDbCommand objCommand = new OleDbCommand(Select, objConnection);
OleDbDataAdapter objAdapter = new OleDbDataAdapter(Select, objConnection);
DataSet objDataSet = new DataSet();
objAdapter.Fill(objDataSet, "Houses");
//OleDbDataReader objDataReader = null;
//objConnection.Open();
//objCommand.ExecuteNonQuery();
//dataGrid1.DataSource = objDataReader;
dataGrid1.SetDataBinding(objDataSet, "Houses");
}
Any ideas
Adz - The World is not enough
__________________
Adz - Learning The J2EE Ways.
|