I am working on a new asp.net web application which has to connect and use an old legacy database. It is not an RDBMS as SQL Server but instead a C-Treive so I should be using ODBC or in my C#/ASP code. I will be using this namespace:
System.Data.Odbc;
Now, my problem is in Web.Config file. I have not used ODBC for years and every time I run the application it throws an error indicating it is an invalid connection.
` add name="DB_Connection" connectionString="Driver=ODBCDriver;server=172.xxx.xxx.xxx;" providerName="System.Data.Odbc"/>
internal OdbcConnection OpenConnection()
{
OdbcConnection conn = new OdbcConnection(ConnectionString);
conn.Open();
return conn;
}
`
{"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"}
This is what I have declared in the Web.Config:
Honestly, I am not sure what would be considered Catalog in this case since it is not SQL Server.
I will appreciate your inputs.
Thanks, Amit
ConnectionString. Need that.add name="DB_Connection" connectionString="Driver=ODBCDriver;server=172.xxx.xxx.xxx;" providerName="System.Data.Odbc"/>