There are possible 2 reasons (as good as i know):
1)
It looks like you do not specify a driver for connection string.
string connStr = "DSN=" + dsn + ";Uid=" + userId + ";Pwd=" + password + ";Database=" + database;
Have a look at commented line and line below this line ;) Do you see the difference?
Tip: I prefer to use
String.Format[
^] method.
string connStr = Format("DSN={0};Uid={1};Pwd={2};Database={3}",dsn, userId, password, database);
If it not helps, please, see these:
http://www.connectionstrings.com/sybase-adaptive[
^]
http://www.connectionstrings.com/sybase-advantage[
^]
How to check if DSN has been properly set up? Using odbcad32.exe application. Read this:
http://support.microsoft.com/kb/942976[
^]
2)
DSN is not availible for some Windows users, because of DSN is User DSN, not system DSN.
Please, read this:
http://digital.ni.com/public.nsf/allkb/852559036FB6447380256ADF007C3964[
^]