Re: Setting NO COUNT default on a connection only(not the entire datab



Nope. SET values cannot be set in a ConnectionString.
In the case of ADO.NET I suggest use of the SqlClient namespace--not OleDb. It's faster, lighter and less problematic.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
http://betav.com http://betav.com/blog/billva
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________




"bryme" <bryme@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:9ACAD204-66AC-45E2-A548-EA87881A098A@xxxxxxxxxxxxxxxx
Is there a way to specify in a connection string that NOCOUNT should be set
ON for a specific SQL Server connection?

We have some databases that will need to be consolidated onto a sinlge
database instance. The majority of the databases require NO COUNT to be set
OFF, while there are also custom developed databases that require that NO
COUNT be set ON. We would rather not have to separate the databases, but
want to know short of updating the code and re-testing for the custom
databases, if there would be parameters that could be set in the database
connection string for the applications. We are using ADO and ADO.Net and the
OLEDB drivers for SQL.

I know there is the default connection setting, but that applies the setting
for the entire database server. We'd like to be able to connect specific to
a database and specify that setting. In Query Analyzer/Management Studio,
that is easily accomplished via either the Advanced Execution setting or
executing the SET statement to change the setting, so surmised there must be
something we can add to our connection strings to accomplish this.

Any ideas?

.



Relevant Pages

  • Re: Connecting to sql server
    ... I hate Visual Basic .NET Standard. ... > I am trying to get a row of data from a SQL Server on our network. ... > I have gone to tools> connect to databases and set up a connection to ... When I test the connection, ...
    (microsoft.public.dotnet.framework)
  • Re: Install Northwind SQL Database?
    ... connection going between Visual Studio and Espress. ... Error connecting to SQL Server 2005 under default settings SQL Server does ... tool for creating and using databases. ... install by default with SQL Express. ...
    (microsoft.public.sqlserver.setup)
  • Re: Parameters Question
    ... the OLEDB provider for Access lets you use named ... > The OLEDB provider for SQL Server will not allow named ... It will work with question mark placeholders. ... > always use question marks for both databases so the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Joining tables from two databases
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... account with rights to both tables. ... to create a connection I need to use a connection ... Are these 2 databases are SQL Server? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Install Northwind SQL Database?
    ... and I am now in business with SQL Server and the Northwind ... tool for creating and using databases. ... you need to create a data connection to SQL Express. ... install by default with SQL Express. ...
    (microsoft.public.sqlserver.setup)