.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

bcp_bind() changes in sql server native client

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

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

View Complete Post

More Related Resource Links

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.

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

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

[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

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

SQL Server Native Client Connection String



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?



Problem with named pipe server in C# and client in native C++ (ACCESS_DENIED)



I'm trying to use IPC between a server application in C# and client application in native C++.

The IPC is "named pipes".

The OS is Windows 7.

It works just fine with C# server and C# client.

It works fine with native C++ server and native C++ client.

However, the native C++ client refuses to connect to same C# server. The error code is 5 (ERROR_ACCESS_DENIED).

Both security descriptors are NULL.

Does anyone here uses such combination or can shed some light on this issues?




ClickOnce: Deploy and Update Your Smart Client Projects Using a Central Server


ClickOnce is a new deployment technology that allows users to download and execute Windows-based client applications over the Web, a network share, or from a local disk. Users get the rich interactive and stateful experience of Windows Forms, but still have the ease of deployment and updates available to Web applications. ClickOnce applications can be run offline and support a variety of automatic and manual update scenarios.Learn all about it here.

Brian Noyes

MSDN Magazine May 2004

SOAP: Using ATL Server to Build an Asynchronous SOAP Client in Unmanaged C++


SOAP opens up a new world of Web Services, letting you make function calls across a network or the Internet. But this flexibility creates new problems when your app needs to wait for calls to return from halfway around the world. What you need is an asynchronous SOAP client that takes advantage of threading to continue execution while waiting for calls over the wire. This article covers the basics of building such a client with ATL.

Pranish Kumar and Bogdan Crivat

MSDN Magazine April 2002

passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



Using SQL Server 2008 R2 client with Enterprise Library



I am modifying an existing application that uses SQL Server 2008 as the database and Enterprise Library 4.1 for Data Access .

What I need to do is to make it use the SQL Server 2008 R2 client to take advantage of out of the box failover capabilities.

Any idea how I can accomplish this?


Educational question: How server objects are accessed from multiple client threads?

I will appreciate it if someone can help me to undestand how the following scenario works:   There is remoting server that is registered as WellKnownObjectMode.Singleton. Server implementation: It instantiates a class TestServer that implements interface IFoo interface IFoo { IHelper GetHelper() }   interface IHelper { void StoreString(); }   Implementation of TestServer: internal sealed class TestServer: System.MarshalByRefObject, IFoo { private IHelper> helper = new Helper(); public IHelper GetHelper(string helper){return helper;} }   Implementation of Helper: internal sealed class Helper : System.MarshalByRefObject, IHelper { public void StoreString (string val) {}; }   Implementation of a client (simplified; shown to illustrate the question only): static class Program { public static IFoo TestService; public static IHelper Helper; public TestThreads testmultiplecalls; [STAThread] static void Main() { TestService = (IFoo)Activator.GetObject(typeof(IFoo),"ipc://Channel"); Helper = TestService.GetHelper(); testmultiplecalls.Start(); } }   internal class TestThreads { public Start() { for (int i = 0; i < 20; i++) ThreadPool.QueueUserWorkItem((new TestCall(i.ToString())).DoWork); } }     internal class TestCall { private string m_str; public TestCall (string str) {m_str = str;} public void DoWork() { Program.Helper.StoreString(m_str); } }     Que

SQL-DMO Install on SQL Server 2005 Express Client

I am installing a Client side SQL 2005 Express that needs SQL-DMO. The Client computer does not have SQL Server 2005 Express installed. I have installed all the MDAC and .Net 2.0. The command line I'm using to try and install the SQL-DMO and XML modules is: SQLEXPR_ADV ADDLOCAL=Tools_Legacy,SQLXML I get a message something like 'SQL Server 2005 Version does not support this install option.' How do I get SQL-DMO installed on a SQL Server 2005 Express Client computer?

Install SQL Server2005 Error:[Native Client]Encryption not supported on the client

Product: Microsoft SQL Server 2005 -- Error 29515. SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client]Encryption not supported on the client. Refer to server error logs and setup logs for more information. For details on how to view setup logs, see "How to View Setup Log Files" in SQL Server Books Online.

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

Unable to connect to SQL Server 2005 remotly, all client protocols are blank

I have an installation of SQL 2005 and had issues connecting remotly. Looking at the client protocolols, they are all blank. I can see that TCPIP, Named Pipes, VIA, etc. are 'enabled', but where the words 'TCPIP', 'Names Pipes', etc. should be, it's just blank. I tried to install SQL 2008R hoping the Client Protocols would be corrected during the installaion, but they were not. I'm assuming the issue with the Client Protocols not showing up is a symptom of the problem. Does anyone have any ideas? Thanks!
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