Click to See Complete Forum and Search --> : Error in connection: could not find installable ISAM


Ctwizzy
February 11th, 2005, 08:54 AM
I have followed the solution my Microsoft and other sites none work.

here is my code


private void tbPunch_Click(object sender, System.EventArgs e)
{

String conString = " ";
try
{
//contructor accepts the database path

conString=@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Documents and Settings\Me\My Documents\Visual Studio Projects\DB\testDB.mdb";

DataSet oDS = new DataSet();
con = new OleDbConnection(conString);
con.Open(); ***** this is where the error is
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();
myDataAdapter = new OleDbDataAdapter("Select * From clockTable", con);

OleDbCommandBuilder myCmdBuilder = new OleDbCommandBuilder(myDataAdapter);

myDataAdapter.Fill(myDtPunch);
this.ShowCurrentRecord();
}
catch (Exception ex)
{
MessageBox.Show("conString = " + conString + " Error in connection : "+ex.Message);
}
finally
{
// dispose of open objects
if (con != null)
con.Close();
} //finally
}

private void ShowCurrentRecord()
{
if (myDtPunch.Rows.Count==0)
{
test1.Text = "No Entries";
test2.Text = "No Entries";
return;
}
test1.Text = myDtPunch.Rows[rowPosition]["IDnum"].ToString();
test2.Text = myDtPunch.Rows[rowPosition]["position"].ToString();
}


Anyone know how to fix this, its put a huge halt in me continuing,

thanks

Krzemo
February 11th, 2005, 09:11 AM
What's the error?

Ctwizzy
February 11th, 2005, 09:13 AM
could not find installable ISAM

Amit_Roy
February 11th, 2005, 10:15 AM
Solved Your Problem ?

Your Connection String is wrong ....

wrong :
conString = @"Provider=Microsoft.JET.OLEDB.4.0;DataSource=.....";

correct : --

conString = @"Provider=Microsoft.JET.OLEDB.4.0;Data Source=.....";

Ctwizzy
February 11th, 2005, 10:21 AM
Ill give that a try.

A lot of the tutorial sites and books i read all say DataSource which is odd if it doesnt work. Plus the error generated suggests that it a wrong error should say something like : ERROR: invalid connection string.

Ill let you know how it works out.

Amit_Roy
February 11th, 2005, 10:24 AM
BTW you have created one object and then another



OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();
myDataAdapter = new OleDbDataAdapter("Select * From clockTable", con);




OleDbDataAdapter myDataAdapter = new OleDbDataAdapter("Select * From clockTable", con);

Ctwizzy
February 11th, 2005, 10:36 AM
Thanks again.

Im learning ADO.net from web tutorials, cant find a decent one yet so if anyone can recommend a good site to get me up to speed on using ADO.NET to do things such as

Query Selects
modify
insert
Remove
Display data
Display data in a dtagrid

anything else of importance.

Thanks

Ctwizzy
February 11th, 2005, 11:05 AM
That did the trick thanks a ton.