ODBC Connection Issue On Client Site

Jun 7, 2007

Hi,


It might be a basic question but could you please help me on that?

Working Environment:

I have developed application on SQL Server 2005 and now wants to Run on Client Site, I am using access as a front end and SQL server 2005 back end through ODBC (System Dsn) which is working good. (user has been added on SQL Server and on Database)

Question:
1) Do I need to create new System Dsn Or other DSN (Keep in mind I have already create System DSN in Server) at each client site to access application from Server?
(If yes then I am trying to do that, it allow me to create (with required database which is on Server) and verify but doesn€™t save on ODBC list so I can€™t use that name to run appliation on client site)

I am using windows authentication.

Thanks for help in advance





View 1 Replies


ADVERTISEMENT

ODBC Connection Issue On Client Site

Jun 7, 2007

Hi,
I am not sure if I select right Froum:)
It might be a basic question but could you please help me on that?



Working Environment:



I have developed application on SQL Server 2005 and now wants to Run on Client Site, I am using access as a front end and SQL server 2005 back end through ODBC (System Dsn) which is working good. (user has been added on SQL Server and on Database)



Question:

1) Do I need to create new System Dsn Or other DSN (Keep in mind I have already create System DSN in Server) at each client site to access application from Server?

(If yes then I am trying to do that, it allow me to create (with required database which is on Server) and verify but doesn’t save on ODBC list so I can’t use that name to run appliation on client site)



I am using windows authentication.



Thanks for help in advance



AA

View 4 Replies View Related

Can't Find SQL Native Client In ODBC Connection Manager In SQL Server Open Database Connectivity (ODBC)

Feb 13, 2007

I apologize if this is not the correct forum for this posting. Looking at the descriptions, it appeared to be the best choice.

I am running Windows XP Pro SP2. I have installed the SQL Native Client for
XP. However, when I try to add a new data source through ODBC Connection
Manager, SQL Native Client is not listed as an option. I have followed this procedure on three other systems with no problems. What would be causing the
SQL Native Client to not show up in the list of available ODBC data sources?

View 4 Replies View Related

ODBC Connection Not Terminating After Client Diconnects

Jan 9, 2001

Hi,

We have SQLSERVER 7.0 in one of the production.
The clients r connected thru ODBC.
The clients doesn't gets disconnected after a task result in
increase in sqlserver log.

Can anyone advice me .

Thanks in advance
Anu

View 2 Replies View Related

ODBC Connection For Client Application To SQL Server 2005 Express Installed On Network Computer

May 5, 2006

Hi All,

I've developed an application that connects to a SQL Server 2005 Express database. I created a DSN to connect to the database through ODBC. Currently, I am testing locally and everything works fine.

I would now like to install my application on another workstation and connect remotely to the database located on my development machine.

The client workstation does not have SQL Server 2005 Express installed on it because I would just like my application to connect remotely by creating the DSN and using ODBC. What I'm missing here are the database drivers. The "SQL Natice Client" is not available on this client workstation. How can I deploy the necessary drivers with my installation file so that I may create the required DSN name using the SQL Native Client driver?

Thanks!

View 6 Replies View Related

No Failover And Client Crashes ODBC DSN Setting For Failover In Connection String

Mar 3, 2007

We have set up Mirroring with a witness server and everything works fine when we failover from the SQL Management console.

However, if we failover when our Maccola client is connected, the client blows up - clearly because it can no longer connect to the database.

The ODBC DSN used by the Maccola client shows a checkbox for the 'select a failover server' but the checkbox is grayed out.

Also the summary of settings for the DSN at the end of the wizard reveals that the failover to server (y/N) option is set to N.

The default setting for this DSN is 'populate the remaining values by querying the server' but it doesn't appear to be getting the settings for failover from the server or any other interactive DSN settings either. The server is clearly set for mirroring.

Another suspicious item is that the DSN cannot connect to the server with SA permissions, even though the server is set to mixed security and we use the correct authentication.

Is it possible that the client MACHINE is not authenticating with the domain or sql server properly. We are logged into the client with the domain account that is the SQL admin account on the sql server box.

We should be able to interact with the sql server settings through the ODBC DSN on the client shoulnd't we?

Are we missing a service pack on the client?

Thanks,

Kimball

View 1 Replies View Related

Client Unable To Establish Connection Encryption Not Supported On SQL Server. (Microsoft SQL Native Client)

May 2, 2006

On Windows XP systems I get the following issue when trying to browse the MSDB folder in SSIS

Client unable to establish connection
Encryption not supported on SQL Server. (Microsoft SQL Native Client)

I have noticed another post where several others have noticed the same issue. It appears to only occur on Windows XP installations. Is there a workaround or fix for this?

View 2 Replies View Related

Integration Services :: Unable To See 64bit ODBC Driver From SSIS Odbc Connection?

Jun 1, 2015

I am using SSIS 2014 with the below .net framework version and installed in Windows server 2012 R2 . I have installed my client's odbc drivers (both 32 bit and 64 bit) in my production server and created ODBC system DSNs for 32 bit and 64 bit.

When i open SSIS 2014 and tried to create the odbc connection but i can able to see only the 32 bit system DSN connection ,i can't able to see my 64 bit odbc system dsn connection.

Microsoft Visual Studio 2012 Shell (Integrated)
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.51650

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.1524.0

And i installed my client odbc drivers(32,64 bit) and created ODBC system DSNs in my local system and when i open ssis 2014 and i can able to see both the ODBC system DSNS(32,64) connections from SSIS ODBC connection.

I am using below version of .net framework in my local system which was installed in windows 7 and i have SSIS 2012 also installed in my system and i can able to see both ODBC connections using 2012 as well in my local system.

Microsoft Visual Studio 2012 Shell (Integrated)
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50938

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.1524.0

why i can not see the ODBC 64 bit system DSN connection from SSIS in my production server ?

View 9 Replies View Related

SQL NATIVE CLIENT - OLE DB Connection On 64 Bit Client

Apr 23, 2008

I have tried this on several different operating systems (VISTA and XP ) and several versions of SQL NATIVE CLIENT including 2005.90.3042.0

I have a 64 bit "SQL NATIVE CLIENT" connection that fails. The exact same connection and code succeeds on 32 bit.
My customer and I prepend "oledb:" to the connection string and it starts working.

FAILS on 64 bit:
Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Wrigley_Test;Data Source=MONGO;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RIPTIDE;Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False

WORKS
oledb:Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Wrigley_Test;Data Source=MONGO;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RIPTIDE;Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False

I debugged my code to the point that I know it is happening when I call CreateAccessor for my SQL statement.


m_hr=m_pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, GetCols(), (m_pDBBinds+IsBookmarked()), 0, &m_hAccessor, NULL);

Error:

Microsoft SQL Native Client: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Does anyone have any suggestions?

View 6 Replies View Related

Client ODBC Errors

Jul 20, 1999

As a SQL adminstrator any maintenance I perform including performing full database backups against the sql server with users connected to a certain database, causes the odbc connection to fail between the web server and the sql database. This causes all clients to experience an odbc failure. The only resolution is to reboot the webserver. There is ODBC driver incompatibilites that exist between the servers. Does anyone have any suggestions? I am in the process of a change control request to upgrade the ODBC on the production SQL server to 3.70.0623 the same as the web server but am not sure that this is the issue. Can there be something in the application itself that would be causing it to break and not reestablish the ODBC connection?

Thanks
David

View 1 Replies View Related

Client/server ODBC Problem

Nov 6, 2004

I have an application on:

W2K client
Sql 2000 + No SP
MS ODBC V3.8
C++

The application, running on the client, connects to SQL server for many simultaneous queries involving select, insert and update. Application creats a thread for each query. Each thread connects to the sql server via ODBC using sqlconnect.

However I find that the individual thread do not close properly and stay open even after sqldisconnect has been issued on the client. At one point I have over 1200 threads on client application trying simultaneously to connect to the server and the sqlserver is holding with 276 threads open.

I do not understand why the ODBC connection stays open even after sqldisconnect is issued. I have even tried disabling connection pooling, to no effect. The performance is very poor.

How can I issue a large number of queries to same sql server via ODBC while guaranteeing performance?

View 2 Replies View Related

ODBC And SQLServer : Does I Need The Client Installed On ?

Jul 20, 2005

Hi,Does I need to install the mssql client binaries to use ODBC toconnect to a mssql database ?TYIArjp

View 2 Replies View Related

Odbc Using Native Client Fail

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

SQLExpress Connection Trouble In Web Site

Sep 12, 2007

Hi all,

I followed an excellent tutorial (from Microsoft) about creating and using a SQLExpress db table internal to your website and the site I created works just fine - locally. When I publish to my web host provider I get this error:

[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]

My web host provider supports .NET 2.0 but doesn't support MS SQL Server. But that should matter - right? Because I'm putting the db instance right in the website?

I did a search and followed some of the advice:

I went into the SQL Server Surface Area Config Mgr and set SQLExpress for local and remote connections and rebooted/republished. I also have SQL Server 2005 installed as a separate entity (if that makes a difference).

I still get the above error. This is the connection string from the web.config:

<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Customers.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

And this is the call from the markup:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [Customer]"></asp:SqlDataSource>

Does any know the fix for this?

Thanking you in advance

Pat

View 3 Replies View Related

How Can Upload And Connection My Mssql Database My Site

Jan 12, 2007

I make a site in my computer it's work localhost I make mssql connection in localhost but ı don't know how i make mssql connection on website
 

View 5 Replies View Related

Remote Connection Refused When Creating ODBC Connection To SQL Server 2005

Aug 30, 2006

When I create a new odbc connection to a SQL server 2005 Db I get a failure telling me dat de SQL server does not allow remote connections.

How can I allow the server to allow this.



Any help appreciated



regards

View 1 Replies View Related

Girl In Need! Anyone Do This: Unix Client -&> ODBC -&> MSSQL Server

Jul 28, 2004

Anyone support a config where you have an unix/linux (AIX here) ODBC client connection to SQL Server database? I am looking for a simple, supportable configuration that does not require me to learn perl or instal a bunch of crap gnu shareware on enterprise class machines.

Please help!

View 2 Replies View Related

Cannot Connect To Sql Server 2005 From Xp Client When Trying To Create ODBC Dsn

Mar 2, 2007

Newbie here,

I am trying to link tables from an access 2003 frontend to sql server 2005 backend.

I am doing this in a vmware test environment. I am using vmware server and running sbs 2003 and xp sp2 client. Both virtaul machine can talk to each other(using local host connection).

I have tried to create a dsn to the sql server but i cannot connect. I can ping the sbs server through the command interface but the error i get when i try to connect is :

Connection failed:
Sql state: hyt00
sqlserver error: 0
microsoft odbc sql server driver timeout expired.

spent a day trying various combinations - still no joy.

Any help would be much appreciated

View 3 Replies View Related

SQL Native Client ODBC On Ia64 And SQLGetStmtAttr(SQL_ATTR_CONCURRENCY)

Dec 12, 2006

We've run into an issue running against the SQL Native Client ODBC driver (version 2005.90.2047.0) on Windows 2003 Server (Itanium). The "INFO: ODBC 64-Bit API Changes in MDAC 2.7" article (http://support.microsoft.com/kb/298678) doesn't say that the returned value for SQL_ATTR_CONCURRENCY changed to a 64-bit value, but if you request this attribute from the SQL Native Client driver, a 64-bit value is returned. The ODBC spec still indicates that SQL_ATTR_CONCURRENCY is a SQLUINTEGER value, which is 32-bit, even on a 64-bit platform.

This is easy to see by using the ODBC Test utility in the Windows SDK for ia64, "C:Program FilesMicrosoft SDKBinWin64ia64odbcte32.exe". If you connect to the SQL Server driver and then simply call SQLGetStmtAttr(SQL_ATTR_CONCURRENCY), you'll see that the *StringLengthPtr argument returns 8 bytes, when it should only return 4.

Note that we've also seen the same behavior with SQL_ATTR_ROW_BIND_TYPE as well as other statement attributes defined to return SQLUINTEGER values.

Has anyone else run into this?

Thanks,

Chris

View 3 Replies View Related

ODBC To SQL Express - SQL Driver Versus SQL Native Client

Aug 2, 2007



I have a SQL express database which I need to access from a shared hosting plan. I can create an ODBC connection through the hosting provider's control panel for SQL Server, but it won't connect. I tested this locally and discovered that the SQL Native Client connects fine, but the previous SQL Server driver does not. This seems to only happen with SQL 2005 Express edition; it works with the Developer Edition. Does SQL Express only use the Native SQL Client??

Thanks in advance for your help!

View 3 Replies View Related

Problem Making Sql Database Connection In Deployed Site

Dec 12, 2007

VWD 2005 Express. Visual Basic.  Sql Server 2005.  I am trying to establish a connection to a SQL database.  The connection (and all other database reads and writes) work fine in debug and in "view in browser" from VWD.  I am running the VWD on the same server that hosts the site.  When on my server (Windows 2003 Server) under IIS, the connection attempt times out.
Below is the code that is failing (only on the server when deployed):
Private Shared Sub OpenConn(ByVal cmd As SqlCommand, ByVal Success As Boolean)
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("GoodNews_IntranetConnectionString").ToString)
'The connection string resolves to ("Data Source=HQSERVERHQSERVER;Initial Catalog=GoodNews_Intranet;Integrated Security=True"
Try
conn.Open()
cmd.Connection = conn
Success = TrueCatch ex As Exception
Success = False
End Try
End Sub

View 6 Replies View Related

Help Usign GetDate() On A SQL DTS With IBM ISeries Client Access ODBC Driver

Oct 21, 2004

I have created a DTS package in SQL 2000 that connects to AS/400 via IBM iSeries Client Access ODBC drivers version R52. I got an error everytime I tried to use the GETDATE() function as follow:

Error Source : Microsoft OLE DB Provider for ODBC Drivers
Error Description : [IBM][iSeries ODBC Driver][DB@ UDB]SQL0204 - GETDATE in *LIBL Type *N not found

Can someone help?

Victor

View 1 Replies View Related

Is It Possible To Use A Simple ODBC Config On A Unix Client To Connect To MS-SQL Server?

Jul 20, 2005

Anyone support a config where you have an unix/linux (AIX here) ODBCclient connection to SQL Server database? I am looking for a simple,supportable configuration that does not require me to learn perl orinstal a bunch of crap gnu shareware on enterprise class machines.Please help!

View 3 Replies View Related

Database Mirroring, Client Connections All ODBC So What Methods Are Recommended?

Jun 5, 2006

As stated in the subject I have a situation where if database mirroring is employed for either manual or automatic failover, all the client (including web connections) connections use ODBC not ADO, or OLEDB etc... so what methods are recommended? Client side redirect is not available so I could not employe the "Data Source =A; Failover Partner=B..." option.

Right now the method employed (pre database mirroring and basically employing log shipping on SQL 2000) is to have a DNS alias for the ODBC connection so that if the server were to change in a failover situation the DNS record would have to be altered, so that all the client connections would not have to be reconfigured.

Regards,

Dominic Baines

View 5 Replies View Related

SQL Native Client ( ODBC ) Convert Function Unicode/SQL_DOUBLE

May 15, 2007

SQL Native Client 2005.90.3042.00 ODBC driver does not return SQL_CVT_DOUBLE as part of the mask from SQLGetInfo for SQL_CONVERT_WCHAR, SQL_CONVERT_WVARCHAR even though driver actually supports converting nchar and nvarchar to SQL_DOUBLE. For example,

select
{ fn convert(N'1.23', SQL_DOUBLE) }

works, but



SQLUSMALLINT nInfoType = SQL_CONVERT_WCHAR;

SQLUINTEGER nInfoValue = 0;

SQLRETURN rc = SQLGetInfo( hdbc, nInfoType, &nInfoValue, sizeof( nInfoValue ), NULL );



ASSERT( nInfoValue & SQL_CVT_DOUBLE ); // fails

View 3 Replies View Related

Connect SQL Server 2005 With ODBC Drive “SQL Native Client

Sep 13, 2007



Hi,



When I'm using SQL server 2005, and ODBC drive €œSQL Native Client€? I get an error when executing the below given code. Error Message: €œTransaction cannot start because more than one ODBC connection is in use.€?



But this works well with SQL Server 2000 with ODBC drive "SQL Native Client" and in SQL server 2005 also when I used ODBC drive €œSQL Server€?.



I used aTrgConn.Execute(€œBegin Transaction€?) and it's working properly. But unfortunately I cannot use this method, because I want to run the same code with Oracle ODBC as well.
Is this a known issue in SQL Native client drive with SQL server 2005? Do you know a solution for this?


Please Help..............



Thanks in advance.




Code:

Dim aTrgConn As New ADODB.connection
Dim aCmdIns As New ADODB.Command
Dim aCmdUpd As New ADODB.Command



aTrgConn.Open sConnStr



Set aCmdIns.ActiveConnection = aTrgConn
Set aCmdUpd.ActiveConnection = aTrgConn

aTrgConn.BeginTrans

View 6 Replies View Related

Open An ODBC Connection To A DB And Must Use A Connection That Looks Like This: DSN=myDSNname.

Dec 11, 2006

In my ssis package,

I have a DSN connection like this: "DSN=myDSNname". Which decide from i have to pull the data.

By using OLE DB Source Editor, I want to assign that ODBC Connection to it.

By data source Reader i can achive this but where i have to pass the hard-code SQL Query that i don't want.

i'm using the variable for dynamic SQL command.

Thanks.

Manoj

View 5 Replies View Related

SQL Server VARCHAR(MAX) Column Returns Error While Inserting Records Into Table(ODBC Driver: SQL Native Client)

Aug 15, 2007

I created very simple table with 3 columns and one is varchar(max) datatype

When i insert records thru VC++ ADO code i am getting this error



Exception Description Multiple-step OLE DB operation generated errors. Check e
ach OLE DB status value, if available. No work was done. and Error Number:: -2147217887



ODBC Driver: SQL Native Client

SQL server 2005



Table

CREATE TABLE [dbo].[RAVI_TEMP](

[ID] [int] NULL,

[Name] [varchar](max) NULL,

[CITY] [varchar](50) NULL

)



VC++ code

#include "stdafx.h"
#include <string>
#include <strstream>
#include <iomanip>


int main(int argc, char* argv[])
{
try
{
HRESULT hr = CoInitialize(NULL);
_RecordsetPtr pExtRst = NULL;
_bstr_t bstrtDSN, bstrtSQL;
bstrtDSN = L"DSN=espinfo;UID=opsuser;PWD=opsuser;";
bstrtSQL = L"SELECT * FROM RAVI_TEMP";

_variant_t vartValueID,vartValueNAME,vartValueCITY;
_bstr_t bstrtValueID,bstrtValueNAME,bstrtValueCITY;

pExtRst.CreateInstance(__uuidof(Recordset));
hr = pExtRst->Open(bstrtSQL, bstrtDSN, adOpenDynamic, adLockOptimistic, adCmdText);

hr = pExtRst->AddNew();

bstrtValueID = L"1";
vartValueID = bstrtValueID.copy();

bstrtValueNAME = L"RAVIBABUBANDARU";
vartValueNAME = bstrtValueNAME.copy();

bstrtValueCITY = L"Santa Clara";
vartValueCITY = bstrtValueCITY.copy();

pExtRst->GetFields()->GetItem(L"ID")->Value = vartValueID;
pExtRst->GetFields()->GetItem(L"NAME")->Value = vartValueNAME;
pExtRst->GetFields()->GetItem(L"CITY")->Value = vartValueCITY;
pExtRst->Update();
pExtRst->Close();

}
catch(_com_error e)
{
printf("Exception Description %s and Error Number:: %d",(LPTSTR)e.Description(),e.Error());
return e.Error();
}
return 0;
CoUninitialize();
}


if i use regular SQL ODBC driver, no error but its truncating the data



Adv Thanks for your help

View 1 Replies View Related

Failed Client Connection By Name Ame.

Mar 7, 2004

Attempting ODBC connection to SQL Server by MachineNameSqlServerName doesn't work.
Can only connect by using IP address of server machine with name of SQL Server instance.
Any help would be appreciated.
thanks

View 3 Replies View Related

SQL Client Connection In AD Domain

Oct 31, 2007

Hi folks,

I have installed SQL Server 2005 on my Domain Controller successfully
and installed the SQL Server tools from the DVD including workstation components on my XP client computer (which is actually hosting the Domain controller as virtual VMWare machine).
The authentication is set to mixed mode and I have created a login with all possible rights on SQL Server, but which is at the same time my Domain Admin (So the user is setup in SQL Server in the format Domainuser)

Now when I open any client program (SQL Srvr2005 Management console, or Toad for SQLSrvr) and try to connect, the client does find the server correctly, but I cannot login.
The error status is actually 1, which means "unexpected internal error" as far as I have read.
I have turned off Windows firwalls by default and also turned off my custom firewall to see if it makes a difference, but it doesn't.

My activated connection protocol on both the server and the client is TCP/IP and I have then changed the port on both the server and the client to a common 4665, which I then granted full passage through my firewall.
Now the error has changed and says "the target machine has actively refused the connection", with status code 0... ???

So that's my current situation... Please, can anyone help me? What am I doing wrong?

Any tips would be appreciated,
-Patrick-

View 3 Replies View Related

Client/Server Connection

Jul 23, 2005

Hi ;I m trying to create Merge Replication. I was able to create thereplication on the same machine, however my aim is to use clientmachine and do all the neessary work on the client machine and thensynchronize to the server. Thus, I have installed client version of SQL2000, I connected to the database server, the thing is when I go offline I lose connection. Is there any way to create the subscription into the client machine as an off line user then synchronize it ?Or DO Ihave create my shopshot on the client machine?If someone can help me I would really appreciateRegardsAs

View 1 Replies View Related

No Connection From The Client To The Server Sql

Mar 6, 2008

Hi.

I have a SQL server with mixed authentication, the user 'sa' is the password zitiz configured. And attach the database server. Locally connection not informing me about errors connection, but when I try to access from the client informs me that there is no server or SQL server has been denied access to the same.

Parameters connection are in a file. Ini contains:
DriverName=MSSQL
HostName=ST-02SQLEXPRESS
Database=MANEXKA
USER_NAME=sa
Password=zitiz
BlobSize=-1
ErrorResourceFile=
LocaleCode=0000
MSSQL TransIsolation=ReadCommited
OS Authentication=True

It has windows xp sp2, framework. Net 2.0 on the server and the client and the firewall is disabled.

How to verify the client or the need to configure the server?

Thank you

View 1 Replies View Related

Connection Object To Client Ce

Mar 2, 2007

 

yo ce folks... Anyone had any trouble using a dataset for return values in a datagridview for the client app?

trying to make this work...

' Open the Connection For SQL Compact Edition

Dim cn As New SqlServerCe.SqlCeConnection("Data Source = " & Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "ffgsCRM.sdf")

Dim cmdProduct As SqlServerCe.SqlCeCommand

' create dataset with table

cn.Open()

cmdProduct = cn.CreateCommand

cmdProduct.CommandText = "SELECT ProductDesc AS Description, ProductCost AS Cost, ProductListPrice AS [List Price] FROM Product"

Dim daProduct As New SqlServerCe.SqlCeDataAdapter(cmdProduct)

Dim dtProduct As New Data.DataTable("Product")

daProduct.Fill(dtProduct)

Dim ds As New DataSet

ds.Tables.Add(dtProduct)

'' FILL DATAGRIDVIEW

Me.dbGridProducts.DataSource = ds

 

I have this working:

' search product description

Dim reqProductSearch As String

reqProductSearch = tstxtSearchDescription.Text

' Open the Connection For SQL Compact Edition

Dim _conn = New SqlCeConnection("Data Source = " & Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "ffgsCRM.sdf")

Dim cmd As New SqlCeCommand()

cmd.Connection = _conn

cmd.CommandText = "select ProductDesc as Description, ProductCost as Cost, ProductListPrice as [List Price] from Product where ProductDesc like '%" & reqProductSearch & "%' ORDER BY ProductDesc"

_conn.Open()

Dim resultSet As SqlCeResultSet

resultSet = cmd.ExecuteResultSet(ResultSetOptions.Scrollable Or ResultSetOptions.Updatable)

'' FILL DATAGRIDVIEW

dbGridProducts.DataSource = resultSet

With dbGridProducts

.Columns("Description").Width = 550

End With

 

Thanks,

Bill

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved