.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Server Native Client Connection String

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :


Currently we are using many config files with SQLNCLI. Is there a way if we would like to use SQLNCLI10 features without changing so many files?



View Complete Post

More Related Resource Links

Connection problem while connecting from client to server.

Hello, i am trying to connect sql server 2005 express using c#.net 3.5. my connection string is "Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\db_naren.mdf;Database=db_naren; Trusted_Connection=Yes;" this is working fine when i am connecting to sql server from the local machine. When i am trying to connect from someother machine to server it is giving error like A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) i added previliges in add new administrator on SQL Server 2005 Surface Area Configuration . and i made changes on SQL Server 2005 Surface Area Configuration  page, on Database Engine --> Remote Connections -->Local and remote connections --> Using both TCP/IP and named pipelines. still same error i am getting from client machine i am using connection string as "Server=MyServer\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\db_naren.mdf;Database=db_nare; Trusted_Connection=Yes;" is there any thing i need to do to connect from client machine to server?please

The SMTP server requires a secure connection or the client was not authenticated.........

i am using asp.net & have a emailing modulewhen i use gmail host i amable 2 send the mail but when i am using yahoo host i get  error msgthe yahoo id & password are right  but still getting the below msg ---------------------------Windows Internet Explorer---------------------------  ' The SMTP server requires a secure connection or the client was not authenticated. Authentication Required. '   ---------------------------OK   ---------------------------

SQL Server allowing access with NATIVE CLIENT Protocols are disabled.

I have disabled all client protocols from SQL Server Configuration Manager -> Sql Native Client configuration -> Client Protocols.Still I am able to access sql server with all client protocols disabled. Why ?Also I stopped the SQL Server Services and restarted it again. Then also the system is allowing me to connect with all the client protocol disabled.

The SMTP server requires a secure connection or the client was not authenticated. The server respons

  here everything with images     http://img704.imageshack.us/img704/5520/problem1w.png http://img704.imageshack.us/img704/2116/problem2j.png   http://img530.imageshack.us/img530/5445/problem3.png   http://img829.imageshack.us/img829/6345/problem4.png            

SQL Server Native Client is substitute of WDAC (MDAC)?

Forking this subquestion from my question Does SQL Server clients use (WDAC, MDAC) and when? Having read msdn article  SQL Server 2008 R2 Native Client Programming I could not understand: Is SQL Server Native Client (SSNC) intended to be used as advanced substitute for MDAC (currently renamed as WDAC)? what one could have understood from th? article... Except that this article tells: "The SQL Server Native Client ODBC driver is always used in conjunction with the ODBC Driver Manager supplied with Windows DAC" From one side it sounds that SQL Server Native Client (SSNC) provide the same functionalities that MDAC (WDAC) and more being "a stand-alone data access API,". From the other side, it is written that SSNC is dependent on MDAC(WDAC) components (drivers, dll) and vice versa. So, why 2 parallel, having essentially the same functionalities, data access structure duplicates?

SQL Server Native Client install fails during prerequisites

Hi I'm trying to install sharepoint 2010 on a new windows 2k8r2 which is a member server on our domain. The server is fully updated. The SQL Server native client installation fails. This is the entry in the error log;   2010-09-15 08:57:26 - Beginning download of Microsoft SQL Server 2008 Native Client 2010-09-15 08:57:26 - http://go.microsoft.com/fwlink/?LinkID=160387 2010-09-15 08:57:28 - Size of download of "Microsoft SQL Server 2008 Native Client" in bytes is "8073728" 2010-09-15 08:57:28 - Download of "Microsoft SQL Server 2008 Native Client" completed successfully 2010-09-15 08:57:28 - Installing Microsoft SQL Server 2008 Native Client 2010-09-15 08:57:28 - "C:\Windows\system32\msiexec.exe" /i "C:\Users\myadmin\AppData\Local\Temp\SQLCF11.tmp.msi" /quiet /norestart 2010-09-15 08:57:28 - Install process returned (0X660=1632) 2010-09-15 08:57:28 - [In HRESULT format] (0X80070660=-2147023264)   If I run the SQL native client installer manually I get the following error; The installer has encountered an unexpected error. The error code is 2755. Server returned unexpected error 1632 attempting to install package.   Any ideas why this is happening? I've had a quick google and can't see anything for SQL Native Client for that error code. Thanks   Olly

get error The SMTP server requires a secure connection or the client was not authenticated. The serv

 Hi,I was able to send mail with no trouble before few days.Then due to some reason, i Formatted pc &  re-installed visual studio & IIS Now when i try to send mail, i get this error.The SMTP server requires a secure connection or the client was not authenticated.In my web.config file i write<mailSettings>      <smtp from="myemail@gmail.com">        <network host="smtp.gmail.com" port="587" userName="myemail" password="xxxx" defaultCredentials="false"/>      </smtp>    </mailSettings>  </system.net>  And on SEND MAIL Button click event I write ( CODE BEHIND)   Dim smtp As New System.Net.Mail.SmtpClient()  Dim smail As New System.Net.Mail.MailMessage smail.To.Add(New System.Net.Mail.MailAddress("contactperson@yahoo.co.in"))        smail.From = New System.Net.Mail.MailAddress("myemail@gmail.com")        smail.Subject = "HELLOO ..HOW R U?"        smail.IsBodyHtml = "true"        smail.Body = "" & txtmail.Text        s

Should I move ODBC Apps from the SQL Server driviver to SQL Server Native Client 10.0

I have a suite of applications written for SQL Server 2000 in Access 2000 and Access 2007 and running under Access 2007 (12.0.6423,1000 SP2 MSO 12.0.6425.1000) via ODBC with the SQL Server ODBC driver (2000.85.1132.00) under Windows XP Professional (2002 SP3).  I have maintained all the data modules in Access 2000 format so that they can be accessed by SQL Server 2008 if required and am gradully upgrading the data modules to SQL Server.  The server they are connected to is Microsoft SQL Server Standard Edition (10.0.2531.0 running on a 32-bit Wndows Server 2008 Standard (SP2).  As a security improvement I intend to move a number of the applications to the server itself.  My choice of driver for ODBC is between SQL Server (6.00.6002.18005) and SQL Server Native Client 10.0 (2007.100.2531.00).  I have yet to discover any differences in application behavior or performance between the two interfaces My assumption is that I will have have fewer problems if I configure the ODBC links using the SQL Server driver.  However, I was wondering if there is a reason to gradually move them over to the SQL Server Native Client 10.0 driver. Thanks, Harry

Connection string to connect with Sql Server 2008.



May  be it's a wrong place to ask the following question. Sorry for that. Our hosting provider has recently upgraded their database server from Sql Server 2005 to 2008 and I'm getting errors to connect with remote server from my development machine. Error Message "Invalid connection". Tried to find solution on net but couldn't find it.

I'm using .Net 1.1. Though we've updated versions 2.0,3.5 & 4.0 but due to some certain circumstances I've no way to update it. It's a web based project. The following connection string works fine for Sql Server 2000 & 2005 but not for 2008.

<add key="ConnectionString" value="Data Source=Remote Server's domain name;Initial Catalog=database name;User ID=user name;Password=surround;Persist Security Info=True;Pooling=false;Connect Timeout=45;" />


Remote Server's domain name indicates to remote db server like: test.mysite4now.com

database name for example: test_surround

user name like test_surround

password: surround.

Can anyone inform me what's wrong with the above connection string to connect to Sql Server 2008.



web.config connection string problem within VisualStudio 2010 to point to SQL Server 2008 R2 Develop


Hello All, I would appreciate any help with this.

I believe my problem exists within the web.config which already had code in it to connect to SQL Server Express 2008.

I uninstalled the SQL Server Express that came with Visual Studio 2010.

I installed SQL Server 2010 R2 Developer, and I'm able to connect via Management Studio and through Visual Studio's Server Explorer's Data Connections I am connected.

I did run aspnet_regsql.exe within the 4.0 folder in order to create the database with Microsoft Service Providers.

Here is the ServerName: USER-5529234649 

Here is the name of the DataBase:  StepByStepChapter9

Here is the name of the Connection within Visual Studio's Server Explorer's Data Connections:  user-5529234649.StepByStepChapter9.dbo

Here is the code I changed in the web.config:

<add name="ApplicationServices" c

Failing Connection String Environmental Variable, XML Variable, System Variable (SQL Server) Setup


We attempted to implement the Chapter 2 Framework from the Knight, Vermeen, Moss, Hackney book on SSIS 2008: Problem Design Solution. We see a couple of problem areas (at least) in our interpretation of the guidelines from the book.

1. We are attempting to have one connection string per server: dev/prod

2. We have set up environmental variables per server: dev/prod

3. We have set up XML Package Variables per server: dev/prod

4. We have set up System Variables per server in SQL Server: dev/prod

Problem 1:

We've had to manually key in the common connection string to all packages on a server environment in the component properties area (control flow; not data flow--ok there)

Shouldn't the connection property find the connection that we've instantiated and provide us with a pull down to select it?

The components are un-editable after we select the common connection string, but they still run properly in our SQL Server Agent Job.

Problem 2:

The dev server variable overlays the prod server variable information duringprod component editing

We are'nt sure if these problems are related.

Here is our package variable:



Here is our DTSconfig file; we have a few variations of this that we've tried.

[Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]


Hello All,

I am using MS SQL SERVER 2008. Im making an application which queries trillion of records. Im using PHP as scripting language. For those functions , which query database and 200 (approximately) rows of DB are returned, everything works fine. But if I query database and a large recordset should be returned, the following error is thrown:

Array ( [0] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258

=> 258 [2] => [Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]. [message] => [Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]. ) [1] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258
=> 258 [2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure ) [2] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => -2147467259
=> -2147467259 [2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure ) )

If I see the error log it shows:

2010-10-17 12:32:38.88 Logon       Error: 18456, Severity: 14, State: 8.

2010-10-17 12

Using connection string instead of datasource in report server 2005



I am using a datasource in the report server where all the reports use that shared datasource while calling the reports from asp.net pages.

Now, as asp.net pages uses the connection string for the databases which is assigned in the web.config file, i want the reports also use the same connection string because you don't need to change on both places( web.config and report server datasource).

Any idea plz

i am working on VS2005 and ssrs 2005


Do not feel regret.... just try to improve..... its far better

SQL Native Client Physical connection is not usable


MessageWay Application receives this error a few times a month (always in the evenings).

, 08S01, [Microsoft][SQL Native Client]Session Provider: Physical connection is not usable [xFFFFFFFF]. Unable to open message - mid: [201010262102102blios] orig-mid: [201010262102102blios]

Messageway is on a Windows 2003 Vitural server.  The database is on Windows 2003/SQL server 2005 SP3 physical server. 

Each time we receive this error the following groups check for problems and can not find any: Networking, VMWare Administrator, WIndows Administrator, SQL Server Administrator.

Any suggestions?


C#, sockets, Windows and port 21 : A simple Client-server using TCP; connection dies after transfer



I have a thread on Stackoverflow here:


In short: 

In a very VERY simple Client-Server solution the TCP connection dies after sending 65535 bytes. This only happens when I am connected on port 21. If I change the server port to for example port 22 the connection does not die.

I am posting the simple code here for reference.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading;
using System.Net.Sockets;

namespace tWorks.Samcom.PassSocketPoller
  public class PollerTest2
    private IPAddress _sutiSocketIpAddr;
    private int _sutiSocketPort;

    private Thread pollerThread = null

bcp_bind() changes in sql server native client


In our old solution we used db-library for bulk copy feature:

bcp_bind(pDBProc, (LPCBYTE) lpVarAdress, 0, nLength,
  (LPCBYTE) lpszTerminator, nTerminatorLength, nType, nColumn)

The value for each parameter used are:

pdbprocess structure, lpVARAdress=NULL(""), nLength = -1,lpszTerminator = "",nTerminatorLength=0,nType=52.

This is running fine with db-library api for the same table, I have migrated the solution to SQL server native client API, and while running this API it is giving me error as

"[Microsoft][SQL Native Client]Attempt to bulk-copy a NULL value into a Server column which does not accept NULL values"

My concern is why the same parameters are running fine with db-library api,table is same no change in column strucutre. HOw can we achieve the same with SQL server native client

Cheers!!! Vatsa www.objectiveprogramming.com

Facing issue with '' for SQL Server Native Client


I have replaced my application which is using DB-Library to SQL server native client. It was for bulkcopy. I am facing a strange issue. When I run the application on db-library it insert the NULL for '' while Native client insert blank for these values and if it is space db-library just trims the spaces and insert the blank while native client inserts spaces.

Can someone please help me why this behaviour and how to get the same with sql native client apis?

Cheers!!! Vatsa www.objectiveprogramming.com
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend