OleDb files needed?

  • Thread starter Thread starter Johan Goris
  • Start date Start date
J

Johan Goris

I've made a small test program. I connect with oleDb (in fact sqlConnection
....etc) to a SQL-server.
It works fine at home.
But it did not work at another place, altough other simple C-sharp programs
work (CLR is installed).
But I tested overthere already with ODBC a connection (ms-access) to the
sql-server and that worked also.Is my connectionstring wrong or is more
needed?
 
Hi,

I would double check the ConnectionString , if you change of location
almost for sure the SQL server is a different server, if not maybe you don't
have access to it, try doing a "telnet SQL_SERVER 1433 " ( by default 1433
is the port of the SQL engine ) and see if you can connect, otherwise that
exception are you getting when trying to connect?

Hope this help,
 
I've made a small test program. I connect with oleDb (in fact
sqlConnection ...etc) to a SQL-server.

Johan,

If you are using SqlConnection, you are not using OleDb. Components
in the System.Data.SqlClient namespace call SQL Server's "SQL Client"
interface directly, and do not go through OleDb.
It works fine at home.
But it did not work at another place, altough other simple
C-sharp programs work (CLR is installed).

What do you mean by "did not work"? Was there an error message?
But I tested overthere already with ODBC a connection
(ms-access) to the sql-server and that worked also.Is my
connectionstring wrong or is more needed?

Please post the connection string.


Chris.
 
The error : Application has generated an exception...
Proces id = Ox... Thread id =...

Connection String I used in SqlConnection: data source=SANOSERVER;initial
catalog=Formules;persist security info=False;user id=sa;workstation
id=LABO;packet size=4096

I do not know at this moment what the connectionstring is in ODBC at the
other computer.

Regards.
 
The error : Application has generated an exception...
Proces id = Ox... Thread id =...

Connection String I used in SqlConnection: data
source=SANOSERVER;initial catalog=Formules;persist security
info=False;user id=sa;workstation id=LABO;packet size=4096

I do not know at this moment what the connectionstring is in
ODBC at the other computer.

Johan,

The connection string looks OK. Is it possible for you to rebuild
the EXE with full debugging turned on? That would make the error
message give much more detail about the error when it occurs.

Chris.
 
Hi,

Try to do a ping to the server to see if there is connectivity. also as I
suggested before a telnet to the port 1433 could be useful.
and do a try catch block around the code and post the exception message

Cheers,
 
Thank you Bob, that was the answer. I had to install MDAC 2.6 or later.
And now I do not have problems anymore.
 
I have placed a try and catch block around the code.
It said that MDAC 2.6 or later needed to be installed.
So I did.
And it worked!
Thank you for the hint.


Ignacio Machin ( .NET/ C# MVP ) said:
Hi,

Try to do a ping to the server to see if there is connectivity. also as I
suggested before a telnet to the port 1433 could be useful.
and do a try catch block around the code and post the exception message

Cheers,
 
Back
Top