SqlDataSourceEnumerator Native C++
May 16, 2008
Hi
I need to browse SQL servers on local and network computers in a native C++ program (MFC / ADO).
I developped a .NET module based on SqlDataSourceEnumerator (works fine), but I cannot use it in my program (CLR is not allowed).
-> Is it possible to use SqlDataSourceEnumerator in a native C++ program (=without CLR) ?
View 1 Replies
ADVERTISEMENT
Mar 27, 2007
Hi all,
I'm encountering a weird behaviour:
I have a .NET application that should allow to select Server and Catalog to install a DB.
I create a mask similar to the one in SQL Server, so i have to fill the Server DropDownList.
This is my code:
SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
System.Data.DataTable table = instance.GetDataSources();
foreach (System.Data.DataRow row in table.Rows)
{
string strDBName, strInstance = row[1].ToString();
if ((strInstance == null) || (strInstance == ""))
strDBName = String.Format("{0}", row[0]);
else
strDBName = String.Format("{0}\{1}", row[0], strInstance);
Program.WriteLog("Row: " + row[0] + ", " + row[1] + " (" + row[3] + ")");
}
Program.WriteLog just writes a string on the log file
Sometimes I need to restart the SqlServer so I Run
CtrlDatabase = new ServiceController(strServiceName);
CtrlDatabase.Stop();
CtrlDatabase.Start();
With the obvious checks
Well the first time, before restarting, the log file is
Row: WKS08, COMPACS (8.00.194)
However if i run Stop & Start the log file is
Row: WKS08, ()
SqlDataSourceEnumerator seems to be not more able to read data.
Why? How can i fix it?
View 3 Replies
View Related
Jun 19, 2007
We are seeing some very strange behavior on installation for our application when it is trying to enumerate the available SQL Server instances. On some machines (not yet determined why) the SQL Browser service is apparently able to locate remote instances but not the local instance. This does not seem to map to any firewall or TCP/IP settings which we can determine. We have gone to the extent of uninstalling all associated firewall and antivirus products, and the problem persists.
For the moment, we are working around this problem by interrogating the registry for the instances installed locally, but this seems unsatisfactory in the long run. Is there any possibility that other instances of SQL Server Express or MSDE have somehow disabled our ability to see local instances? I would really like to find a better solution to this problem.
Andrew Raymond, MCAD.NET
Senior Developer
Mitchell 1
View 2 Replies
View Related
Oct 6, 2006
I made a point type by C# for deploying in SQL2005.
It builds successfully every time.
When I deploy, it gives the following error:
"Error: Type "SqlServerProject1.TypePoint" is marked for native serialization, but field "x" of type "SqlServerProject1.TypePoint" is not valid for native serialization." although x variable is value type decimal.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
[Serializable]
[SqlUserDefinedType(Format.Native, IsByteOrdered=true)]
public struct TypePoint : INullable
{
private bool m_Null;
private Decimal x;
private Decimal y;
public override string ToString()
{
// Replace the following code with your code
if (IsNull) // added part
{
return "null";
}
else
{
return x + ":" + y;
} // end of this part
// return "";
}
public bool IsNull
{
get
{
// Put your code here
return m_Null;
}
}
public static TypePoint Null
{
get
{
TypePoint h = new TypePoint();
h.m_Null = true;
return h;
}
}
public static TypePoint Parse(SqlString s) // Most Important Part
{
if (s.IsNull)
{
return Null;
}
else // added part
{
TypePoint p = new TypePoint();
string str = s.ToString();
string[] xy = str.Split(':');
p.x = Decimal.Parse(xy[0]);
p.y = Decimal.Parse(xy[1]);
return p;
}
}
public Decimal X
{
get
{
return x;
}
set
{
x = value;
}
}
public Decimal Y
{
get
{
return y;
}
set
{
y = value;
}
} // end of added part
// This is a place-holder method
public string Method1()
{
//Insert method code here
return "Hello";
}
// This is a place-holder static method
public static SqlString Method2()
{
//Insert method code here
return new SqlString("Hello");
}
// This is a place-holder field member
public int var1;
}
View 4 Replies
View Related
Nov 16, 1999
Is it possible to do a native BCP from 7.0 to 6.5? I'm having all sorts of data issues when I try.
Would a character bcp work (albeit slowly) instead?
View 1 Replies
View Related
Feb 20, 2007
Hello.
Does anybody knowk if it's necessary to upgrade Sql Native Client to conect to a Server when you has upgrade it to Sql 2005 SP2? That is to say, can you conect to a Sql server 2005 SP1 and to a Sql Server 2005 SP2 from a client with the same Sql Native client or you have also to upgrade it?
Thanks.
View 7 Replies
View Related
May 14, 2007
We have a VB6 app that we're trying to connect to an SQL2005 server.
We're able to connect from dev machines that have SQLExpress, or SQL 2005 tools installed, but we cannot connect from other machines. We've installed sqlncli.msi from the MS site, but this still doesn't work. When we try to login, we get an error that reads "0[Microsoft][SQL Native Client]Fractional truncation" when we try writing to a smalldatetime field. This problem does not happen on the dev machines.
Connection string:
connectiontype = cnnSQLServer
database name = name
pasword = password
userid = uid
servername = servername
driver = {SQL Native Client}
Driver version on the dev machines is: 2005.90.3042.00
Driver version on the roll out machines is: 2005.90.1399.00
What are we doing wrong?
Zeke.
View 1 Replies
View Related
Jun 15, 2000
Does anyone know where to find the native datatype formats of sqlserver6/7?
View 1 Replies
View Related
Aug 16, 2007
We're upgrading from SQL2K to 05 next week. We want to push the SQL Native Client driver(ODBC) thru the network but IT said it can only be an msi or exe file. Is their anyway we could get this file in this format?
View 4 Replies
View Related
Feb 22, 2008
Hi all,
Ms SQL Server Native Error 18456 !! Login Failed.
Pls help me out.
Thanx in Advance
View 7 Replies
View Related
Apr 3, 2008
Anyone have experience with using SOAP/Native XML Web Services in SQL Server 2005 to expose data to external web clients? Any issues/pitfalls?
-A
View 2 Replies
View Related
Oct 21, 2014
I'm wondering if I can take native SQL log backup in addition to DPM backups. We're using DPM for both databases (daily) and logs (every 15min). So, if I take SQL log backup separately, will it break anything in DPM and we won't be able to perform point it time recovery?
View 3 Replies
View Related
Sep 5, 2007
I'm new in this forum and I 'm Italian, so my English won't be perfect!
If i want to connect to my SQL Server database in prompt i type:
"osql -U sa" and then i type the password.
So, I get an error that says:
"[Sql Native Client] Provider Via: Impossible to find the specified module.
[Sql Native Client] Access timeout expired
[Sql Native Client] An error occured during the attempt to estabilish a connection to the server. During the connection to SQL Server this error may be caused by pre-defined settings that don't ......"
How i can solve this problem?
Who can help me?
Thank you!!
Maxx
View 3 Replies
View Related
Mar 11, 2007
Hello,
Can I use the "SQLOLEDB" provider to connect to a SQL Native Client? Follow-up question: does the "SQLOLEDB" provider use the same TDS transport protocol as the SQL Native Client provider?
Thanks as always!
dotBomb
View 6 Replies
View Related
Feb 14, 2006
Hi!!!
I got a problem, if i try to connect with SQL Native client by IP (exemple: 192.168.1.2MYDATABASE) it doesn't work. But I use: HOMEMYDATABASE it works. But in the 2nd case i cannot connect to SQL Server from another computer.
Thanks fr your help.
fred
View 7 Replies
View Related
Apr 23, 2008
The Clients Environment:
Windows Server 2003 R2
SQL Server 2005 SP1 Standard Edition Version 9.00.2153.00
SQL Native Client Version 2005.90.2047.0
My Development Environment
Windows XP
SQL Server 2005 SP1 Developer Edition Version 9.00.2047.0
SQL Native Client Version 2005.90.3042.0
The Error: [Microsoft] [ODBC SQL Server Driver] Fractional truncation
We have tons of VB 6 legacy code. (I know.. we are trying to get it to .Net.. just not enough time in the day) We recently installed our application at a cleints site (environment listed above) and all of a sudden we are getting errors every time we execute a rs.update using ADODB. I have pasted an example below. The kicker is that it runs fine in my development environment. I can get around this issue by using a command object to do the insert, but we have thousands of these sprinkled throughout the application and would take weeks to change them over; and of course this client demands to start using our application NOW. I am inclined to think that it is an issue with SQL Client since it does not appear to have been updated when the SP1 was installed. I have read some blogs about issues with SQL Native Client and datetime values.
'Broke Code
Dim RS as New ADODB.Recordet
Dim SQL as String
Dim datGetDate as Date
'THis select statement return an empty recordset. ID is an identity column
SQL = "SELECT * FROM table WHERE id is null
RS.Open SQL, gadoConn,adOpenKeySet, adLockOptimistic
RS.AddNew
RS("col1")=Value1
RS("col2")=Value2
RS("starttime")=datGetDate
RS.Update 'This is where it blows
RS.Close
'New and Improved code. Works perfectly
Dim SQL as String
Dim objCMD as new ADODB.Command
SQL = "INSERT INTO table(col1,col2,starttime) values('" & Value1 & "','" & Value2 & "','" & datGetDate & "')"
With objCMD
.ActiveConnection=gadoConn
.CommandText=SQL
.CommandType=adCmdText
.execute
End with
Thanks!
View 8 Replies
View Related
Sep 18, 2007
We are using Visual Studio 2003 to develop a VC++ application to support SQL Server 2000 and 2005 through ODBC driver. I was able to successfully test the application with ODBC driver for 2000. But when it comes to the SQL Server 2005 using native ODBC driver it fails with "ODBCBCP.dll is not compatible with 'SQL Native Client' driver. Please configure 'SQL Server' driver for the DSN or connection string.
Then I tried to use the sqlncli.h inplace of odbcss.h and replaced the odbcbcp.lib with sqlncli.lib pointing to the C:Program FilesMicrosoft SQL Server90SDKLibx86 folder.
Code Snippet
#include <sql.h>
#include <sqlext.h>
#include <sqltypes.h>
#define _SQLNCLI_ODBC_
#include <sqlncli.h>
Now I can not compile the program. The errors I am getting are as follows:
c:Program FilesMicrosoft SQL Server90SDKIncludesqlncli.h(2894): error C2061: syntax error : identifier 'DB_UPARAMS'
c:Program FilesMicrosoft SQL Server90SDKIncludesqlncli.h(2901): error C2061: syntax error : identifier 'DB_UPARAMS'
etc
c:Program FilesMicrosoft SQL Server90SDKIncludesqlncli.h(2938): error C2061: syntax error : identifier 'HCHAPTER'
c:Program FilesMicrosoft SQL Server90SDKIncludesqlncli.h(2944): error C2061: syntax error : identifier 'HCHAPTER'
etc
The same code just works fine in the Visual Studio 2005, but we need the dll in Visual studio 2003.
I think I am missing pretty obvious. Your help is appreciated.
View 1 Replies
View Related
Oct 15, 2007
I have created a table using SQL SERVER 2005 with column datatype as varbinary and with column size as 'MAX':-
i.e:
create table tablename {
column varbinary (MAX)
}
When i try to query for Column precision using SQL Native Client ODBC Driver it returns '0' instead of 2^31-1 (which is the value for MAX), but when i use other driver it works as expected. If i assign some value like varbinary(20) then it works.
Please let me know is there any fix pack available for this. Because one of our client is facing this problem, so we have to provide solution as early as possible:
Version of SQL Native Driver : 2005.90.1399.00
Any help would be appreciated.
View 4 Replies
View Related
Jul 16, 2007
Hi,
What is the best way to have native win32 code tell SQL Server 2005 Express to synchronize for merge replication? What API should I use? Should I exec the distrib.exe and/or replmerg.exe command line utilities? Should I use "Windows Synchronization Manager"? Are they other options?
Thanks,
Bryan
View 4 Replies
View Related
Sep 5, 2007
I'm new in this forum and I 'm Italian, so my English won't be perfect!
If i want to connect to my SQL Server database in prompt i type:
"osql -U sa" and then i type the password.
So, I get an error that says:
"[Sql Native Client] Provider Via: Impossible to find the specified module.
[Sql Native Client] Access timeout expired
[Sql Native Client] An error occured during the attempt to estabilish a connection to the server. During the connection to SQL Server this error may be caused by pre-defined settings that don't ......"
How i can solve this problem?
Who can help me?
Thank you!!
Maxx
View 1 Replies
View Related
Sep 9, 2007
Hi
How can I check "Native client" is present on my client? I'm trying to eliminate all the reasons my client won't run a VC++ app which access a sql server.
thanks
Z
View 4 Replies
View Related
Oct 27, 2007
Dear brothers, still have problem with .net compact framework 1.1 (2003) when i try to sync the data between sqlce and sql server 2000 " not from the first time some times from several times of using the syncronization"
is there any services pack for sql ce
what is appropriate cab file(.NET COMPACT FRAMEWORK, SQLCE etc is ARMI,ARM4....) version for windows mobile 5 with intermec CN3 Device
View 2 Replies
View Related
Jan 22, 2007
Hello,
my question is, what is "better" for relative simple querys.
native stored procedures or the clr method?
The procedures are relative simple select's or insert's.
What are the advantages of clr procedures? perhaps you have some links to read about...
thanks and greets from germany!
Dirk
View 5 Replies
View Related
Jul 18, 2006
Can anyone provide any direction in extending existing SSIS components with a custom component, if it's possible at all. In some cases there are just slight bits of functionality missing that I think I could add in myself. But, I'm not much of a programmer and need a bit of help in the declaration of the component in my own custom component.
Thanks.
View 1 Replies
View Related
Mar 11, 2008
Has there been any statement on when SQL CE will natively support 64-bit platforms?
Our application could grealy benefit from the capabilities of SQL CE 3.5. Of significant importance are the ability to completely embed the db engine in-proc, as well as privately deploy the libraries. The bottom line - the user never knows we are actually using a DB engine.
The problem is, our entire application is .NET 3.5, C#, WCF, and we need to support both 32/64-bit Server 2003 and Server 2008 platforms. If we move some of our file-based storage to a database, SQL CE is the only good fit.
Thanks in advance for any information and/or suggestions,
Bob
View 1 Replies
View Related
Aug 7, 2007
I want to add a step to an SSIS package to passthrough native Teradata sql statements so that they can be executed on Teradata. Does anyone know if I can use an "Execute SQL Task" to accomplish this? It should be very similar to passing native Oracle SQL to an Oracle server.
View 6 Replies
View Related
Mar 23, 2006
Are SQL Server 2005's native Web services available in SQL Server 2005 Express Edition?
Thanks.
View 8 Replies
View Related
Jun 4, 2008
and TCP as a connection method.
When using Named Pipes the issue is no longer there.
On massive batch inserts we sometimes get a long pause at the end of one insert and before begining the next one. Example:
1000 inserts in the same table and then repeat. This will work fine for 3 or 4 iterations, then pause during the 5th iteration for up to 40 seconds and then simply continue.
When this exact same procedure is done using Named Pipes as the connection method this never happens.
While this is happening neither the server or the workstation is doing anything, 0% CPU, 0% network, it just sits there.
All this using the SQL Native Client 2005 and ADO.
Anyone have any ideas?
View 8 Replies
View Related
Mar 23, 2007
Hi All,
The situation I have is I want to push out SQL Native Client to all the comupters on our network and also create a dsn once the client has been installed.
Can somebody please tell me the best way to go about this.
Any help would be much appreciated.
Thank You
View 1 Replies
View Related
Feb 4, 2008
I cannot connect to my SQL2005 server using the old SQL ODBC drivers, I have to use the Native client drivers. The database I am trying to connect to is a SQL 2000 db I just attached. Its owner is a SQL user login, which works fine and can connect remotely.
Thoughts?
Possibly related: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=96732
View 1 Replies
View Related
Feb 8, 2008
All,
I was trying to install SQL Server 2005 on Windows 2003 Server and it failed on installing one of the components "SQL native Client",
the Error message is
The Installation Package of the Product Microsoft SQL Server Native Client cana not be found. Try the Installation again using the Valid copy of the installtion package "sqlncli.msi"
Thx
View 2 Replies
View Related
Nov 16, 2006
Hi,
Our software uses native ODBC driver and Visual C++ 2003 to communicate with SQL Server 2005.
SELECT xml_schema_namespace(SCHEMA_NAME(schema_id) ,name) FROM sys.xml_schema_collections.
SQLDescribeColW returns -152 as the datatype for the column in the above select statement. However, I€™m unable to find a preprocessor definition for -152. The datatype looks like an nvarchar. Is it an nvarchar? Where can I find the definition for this datatype?
I have discovered similar problems while bringing back SQL_VARIANT types. The returned subtype of a SQLVariant comes up with -16 and -25. I cannot find definitions for these sub types either.
Any help is appreciated.
Regards,
Venkat
View 5 Replies
View Related
Aug 26, 2007
I installed sql2005 on server, created odbc connection , sucess connection.
I installed native client on pc. pc ping server sucessfully. I created odbc using sa with valid password (as i do in server), when completing give error " sql server does not exist or access denied" , and can not connect with server.
how can i resolve the problem.
View 1 Replies
View Related