1

Here is my Connection.cs:

public class Connection
{

    public static string connectionstr = ConfigurationManager.ConnectionStrings["connectionstr"].ToString();

    public static OleDbConnection DBconnection()
    {
        //
        // TODO: Add constructor logic here
        //
        OleDbConnection con = new OleDbConnection(connectionstr);
        if (con.State == ConnectionState.Open)
            con.Close();
        con.Open();
        return con;
    }

}

when i enter input values and submit, it shows error something like this,

This is the error:

System.Data.OleDb.OleDbException`: Could not find installable ISAM

I'm new to .NET framework and I just created login.aspx, so I don't have add any source code.

My connection string is

<connectionStrings> 
    <add name="connectionstr" connectionString="Provider=Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|\registration.mdb;User Instance=true" providerName="System.Data.OleDb" /> 
</connectionStrings>
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
pcs
  • 1,864
  • 4
  • 25
  • 49

1 Answers1

3

Your connection string includes the argument

;User Instance=true

which does not apply to the Access OLEDB providers (Microsoft.Jet.OLEDB.4.0 and Microsoft.ACE.OLEDB.12.0).

When I included that argument I got the "Could not find installable ISAM" error like you did. When I removed that argument the error went away.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
  • okay sir.. i changed my code, but now it shows error like this "Number of query values and destination fields are not the same." in the line "com.ExecuteNonQuery();" .. what to do? – pcs Oct 23 '15 at 15:34
  • That is a different question so you should [ask a new one](http://stackoverflow.com/questions/ask). – Gord Thompson Oct 23 '15 at 15:37
  • [What is the the best way to ask follow up questions?](http://meta.stackoverflow.com/q/266767/2144390) – Gord Thompson Oct 23 '15 at 15:42