Groups | Blog | Home
all groups > sql server (alternate) > july 2004 >

sql server (alternate) : Deployment Question, Connection string issue.



olaamigoquepasa NO[at]SPAM hotmail.com
7/14/2004 9:21:22 AM
When we deploy applications, we have been using DSN's set up on the
users systems. Then in the sqlconnection string, we go "dsn = xyz". I
tried this with our new application, which is the first to be done
with ADO.net and I get the following run time problem:

"An exception 'System.ArgumentException' has occured in <Myapp>".
I do the run time debugging and it tells me: "Keyword not supported:
'dsn'.

For those who have migrated to .Net, how do you handle this issue? I
mean, we are going to distribute this application, and our users will
have different names for their servers, so how do we specify a data
source dynamically.

The way we have it for the moment is that we read the information from
a config file. But it seems like there must be a better way. What
happened to dsn?

Any help on this would greatly appreciated.
Thanks,
Ed Hawkes
Erland Sommarskog
7/18/2004 9:55:14 PM
Ed Hawkes (olaamigoquepasa@hotmail.com) writes:
[quoted text, click to view]

If you despearately need DSN, I would suppose you could use OleDb
client rather than SqlClient.

As for what happened, I guess DSN got of fashion, and I can't say that
I miss it. Our application - which is VB6 - once used DSN, but now you
can specify server and database on the login form (and the values are
saved in registry between invocations), which I very much like. Of course,
end users normally use the same server and database, and it's only
developers like me, who change all the time. But nevertheless, DSNs
is just one more thing that has to be configured, and which could buy
settings you did not expect.

IF you don't want to prompt your users, a config file seems like a
good way to go.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
olaamigoquepasa NO[at]SPAM hotmail.com
7/19/2004 9:01:13 AM
[quoted text, click to view]


Erland,
much obliged! I really appreciate the response, and this will help
move our project along. Thanks again.
Cheers,
AddThis Social Bookmark Button