Loosing Database Connection When Device Power-off (native Oledb Code)

Jul 12, 2006

Hi,

I experienced this problems on both Windows Mobile 2003 SE and Windows Mobile 5.0.

Its native development (c++, oledb, atl and mfc).



It's quite simple to reproduce...

1. open a database

2. open a rowset on table A (whatever, valid of course and with both IOpenRowset and ICommandText), read datas and close rowset

3. power off

4. power on

5. try step 2 with another table (failed on openrowset with error 0x80004005) or try table A (sometimes working because of cached memory, sometims failed on Read Datas).

6. being stuck ;-)



Our work-around was, in case we loose our connection (identified by error 0x80004005 on openrowset), we close it and re-open database... ugly for sure, but working.



What I'm looking now is to use some kind of "detection method" like what people in .Net develoment are using "if ConnectionState.Open <> ...) for reopening my database only on demand...



Thanks in advance for any hints,
Fabien.

View 5 Replies


ADVERTISEMENT

Visual Studio 2005 The Remote Connection To The Device Has Been Lost. Please Verify The Device Connection And Restart Debugging.

Jun 19, 2006

Basically I've been using Visual Studio 2005 for a few weeks now moving a Pocket PC project from 2003 to 2005. When I hit the Start Debugging Button every time until today the project would rebuild and deploy to my pocket PC allowing me to debug etc but now I get

The remote connection to the device has been lost.

Please verify the device conection and restart debugging.

I used to get this problem in VS2003 sometimes and just like the numerous posts on different sites that I've looked at the problem eventually goes away and I'm none the wiser. One guy said that he found that if he went to bed the problem was resolved when he came back!

My PDA running Windows 2003 2nd Edition is directly connected to my PC via a USB port. I've rebooted my PC and done a soft reset on the PDA but it didn't help. I'm using ActiveSync 4.1.

Does anyone know how to resolve this problem?

View 54 Replies View Related

Ssis Oledb Connection Error Code: 0x80040E21.

Jan 25, 2007

howdy,
i have a sqlserver2005 ssis package which connects to a mysql webserver to upload data. i am connecting via mysql oledb connection and am able to test connect ok through the oledb connection manager. However in my ole db destination editor i get an 0x80040E21 error when trying to preview a table . The full error is :

Error at Data Flow Task [Destination - Query [70]]: An OLE DB error has occurred. Error code: 0x80040E21.

Error at Data Flow Task [Destination - Query [70]]: Opening a rowset for "INFORMATION_SCHEMA.address_book" failed. Check that the object exists in the database.
------------------------------
ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

I can see all the tables in the drop down box in connection manager. This has been driving me nuts for the last 3 days! I have tried changing some of the security connection settings to no avail, (although i am not sure on what these do).I have also tried setting up as an odbc connection using script components but had memory errors after copying several hundred records and the package just hangs. I can go into this in more detail however i dont think they are related issues and i would prefer oledb as i dont have to script my data transfer.

any help much much appreciated.

thanks

View 3 Replies View Related

(Project Real Implementation) Error Code: 0x80004005 OLEDB Connection To SQL Server

Mar 25, 2008

Hi List
Im trying to set up an implementation of Project Real --it works like this-
Create two system environment variables called REAL_Root_Dir and
REAL_Configuration with the values given below. Click on
Start -> Control Panel -> System. Go to the Advanced Panel, click Environment Variables button, then New in the System variables box.

If the Project REAL files were installed at C:Microsoft Project REAL, then the variable values will be:

Variable Name: REAL_Root_Dir
Variable Value: C:Microsoft Project REALETL

Variable Name: REAL_Configuration
Variable Value: %REAL_Root_Dir%REAL_Config.dtsconfig



The package OLEDB connections work like this
First read enviroment variable to get location of config file
Next read Config File to get connection string for Config Database
<?xml version="1.0"?>
<DTSConfiguration>
<Configuration ConfiguredType="Property" Path="Package.Connections[SQL - Configuration].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=(local);Initial Catalog=DataWarehouseABC;Provider=SQLNCLI.1;Integrated Security=SSPI;</ConfiguredValue>
</Configuration>
</DTSConfiguration>
Next read Config database to get connection strings for Source and Destination databases



Destination database is called "DataWarehouseABC"
Source database is called "SnapshotABC"


the Source database OLEDB connection works 100%
however the destination OLDB connection we get this error below
PS--Both source and destination databases are on the same development machine , however both databases are restored bak files from another production machine







Error 1 Error loading LoadGroup_Daily.dtsx: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Login failed for user 'xxxxxx'.". An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Cannot open database "DataWarehouseABC" requested by the login. The login failed.".


Any ideas on how one OLEDB Connection in this package can get this corruption


thanks in advance
Dave

View 5 Replies View Related

Loosing ODBC Connection

Apr 26, 2006

Hi all,

We recently converted an application from accecc97 to access2003.
We used to have 2 databases : 1 with all and only the data (axelD.mbd), 1 with all the forms, query's, ... (axelP.mdb)

We replaced the data (axelD.mdb) with an MSDE database, through UPSIZE and so on. That all worked fine.
This database is placed on the dataserver (DATA1), the converted programm is on the FRONT2 server (FRONT1 stil usess access97 until conversion is totally ready).

We are able to connect to the MSDE by using ADODB recordsets.
We are also perfect able to link the MSDEtables in our axelP.mbd database

We started to test some heavier parts of our application and started to get the following error:

"ERROR 3151"
"ODBC--connection to 'JOROSOFT' failed"

Nothing more.

This happened in a quite complex routine, whitch updates a lot of records, several times and so on.
We could reproduce the same error when executing the following code:


Public Function TestBestellingen()
Dim sql As String
Dim intervalset As DAO.Recordset
Dim planset As DAO.Recordset
Dim tellerke

x = Opendatabases()
tellerke = 0
sql = "Select bestelnummer from vkpbestellijn where bestelnummer > 100000"
Set planset = Db_AxelP.OpenRecordset(sql, dbOpenDynaset)
Do While Not planset.EOF
tellerke = tellerke + 1
Debug.Print tellerke & " - " & planset!Bestelnummer & " --> " & IsKlantStof(planset!Bestelnummer)
planset.MoveNext
Loop
End Function

Function IsKlantStof(p_bestelnummer)
Dim sql As String, rst As DAO.Recordset
Dim hulp_klantstof As Boolean

hulp_klantstof = False
x = Opendatabases()
sql = "select klantstof from vkpbestellijn where bestelnummer = " & p_bestelnummer
Set rst = Db_AxelP.OpenRecordset(sql, dbOpenSnapshot)

With rst
Do While Not .EOF
If !KlantStof = True Then
hulp_klantstof = True
.MoveLast
End If
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
IsKlantStof = hulp_klantstof
End Function

Function Opendatabases()
If Db_AxelP Is Nothing Then
Set Db_AxelP = DBEngine(0)(0)
End If
End Function
I know this code makes no sence in a real-time environment, but it was to reproduce the error.
This code basically runs trough a 30.000 records and does a little check for certain fields
After 1981 records we get the above error.
(sometimes after 1979 or 1980 or 1982 records)


1977 - 100859 --> True
1978 - 100860 --> True
1979 - 100860 --> False
1980 - 100861 --> True
1981 - 100861 --> True


"vkpbestellijn" is a table that is linked in the AxelP.mdb trough an ODBC connection.
We get the same error (and after 1981 times) if I change the where to a totally other range of "bestelnummer"

I have installed the latest patches of Jet 4.0, MSDE-server, ...

I've been searching the internet for abour 3 days now, and just cant even find the smallest clue what could make this happen.

I hope someone here has an idea.
If you need more details, just ask.

tia,
Axel.

P.S. I'm from Belgium, so my english aint "correct to the point".

View 3 Replies View Related

Loosing SQL Connection While Running ASP

Jul 20, 2005

We are running an ASP application. That is fairly simple.It selects from one table (15.000 records), and updates into another table.But when we execute the ASP script, it reports the following error, aftercompleting between 70%-80%. This varies each time it runs"Microsoft OLE DB Provider for SQL Server error '80004005'[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or accessdenied. "The application is running in ths following server environmentServer 1Fujitsu-Siemens RX300 Server (Dual 2,8 Xeon, 1 Gb Ram, 72 Gb SCSI Raid 1)Windows 2003 Web Server (IIS)Server 2Fujitsu-Siemens RX300 Server (Dual 2,8 Xeon, 1 Gb Ram, 72 Gb SCSI Raid 1)Windows 2003 Standart serverMicrosoft SQL Server 2000

View 5 Replies View Related

CE Database Oledb Connection

Jan 5, 2008

I have tried to connect ce database by using c++ and oledb, and failed in every turn, i dont know what i did wrong...

I created a new database by using create a new database sample in ssce bol, but i couldnt connect that database, it says invalid class string or authentication failed...

here is a simple example...

HRESULT hr;
CDataSource db;
hr = db.Open( "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=Newdatabase.sdf;Password='db_pwd'" );
if (FAILED(hr))
{
return;
}

and also, afx oledb headers causing lots of redefinition warnings, if i include both ssce headers and afxole headers...

and also oledb example in ssce bol download is missing, there is no such like example...

can you provide me simple example to connect any ce database?



Installed programs
visual c++ 9.0
sql server ce books online
sql server ce 3.5 runtime
sql server ce 3.5 server tools
windows xp sp2


thanks in advance

View 1 Replies View Related

Loosing Connection Upon Refreshing Page

May 31, 2005

Hi,

I'm getting a connection and then loosing my connection upon refreshing the browser with this script connecting to MSSQL using php, when trying the following:


PHP Code:




 $connection = mssql_connect("127.0.0.1","test","") or 
die("Could not connect mssql db on " .$config['dbhost']);
        
mssql_select_db("dbName") or
die("Could not select database " ."dbName"); 






Are their other ways to see more error handling in connecting to MSSQL

View 1 Replies View Related

Where Can I Find Northwind OleDb Native Sample Application

Jun 22, 2007

Where can I find Northwind OleDb Native Sample Application?



KB 909751 states to install VS 2005 with: "Smart Device Programmability install option"



When installing VS 2005 I do not get the opportunity to specify this option..



What am I missing?



Thanks in Advance..



JEK

View 3 Replies View Related

SSIS OLE DB Connection Keeps Loosing Mapping Of Last 4 Fields

Nov 2, 2007

I have a script and on one of the tables I keep loosing the mapping of the last 4 fields. If I go into the task it will ask me if I want it to automatically fix it and I say yes and remap fields but when I run it it bombs and comes back and when I go back into it it tells me there is a problem with same fields. It also rearanges the order and puts these fields last.

I have tried deleting and redoing the transformation only to have the same thing happen. Almost seems like a bug in software. I have seen this before but usually when I fix it it does not return.

View 5 Replies View Related

Native Error Messages In OLEDB Destination (and Hopefully Forthing ADO.NET Dest)

Jul 15, 2006

For both OLEDB destiantions (and hopefully for the forthcoming ADO.NET destination adapter) it would be useful to have the following two output columns: NativeErrorCode and NativeErrorMessage.

For SQL Server, this would allow you distiguish between multiple errors which all roll up to the SSIS error "the value violated the integrity constraints of the column", which is way too generic for proper decision making (via conditional split).

For example, like SQL Server replication, you should be able to ignore duplicate key errors (error number 2627) indicating the record existed, but error out on nullability constraint errors (number 515) in which the record could not be inserted. If you had a native error code, you could make this decision, while the SSIS error for two different native errors is precisely the same.

There is a known and accepted race condition between a lookup transform and subsequent OLEDB dest insert attempt (assuming a non-transacted container and a common component target table), which is why the 2627 can be safely ignored in certain instances, while a 515 should not be.

View 1 Replies View Related

Integration Services :: Dynamic Database For OLEDB Connection Manager In SSIS

Nov 10, 2015

I am trying to dynamically change my initial catalog in a SSIS project. Each day I get a snapshot of data from the production server. I am performing ETL on that database and loading it into my warehouse. I am trying to put something together so that each day I get the latest snapshot and if its newer then my most recent one I pass that new catalog into the connection manager. I can already run the sql script to compare the two catalogs but I can't populate the connection manager.

View 3 Replies View Related

Using Native Code To Synchronize

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

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

Calling Native Code From A Trigger.

Jun 26, 2007

I've been searching for a bit but I can't seem to find a difinitive answer.



Can an SQL Server trigger call native C/C++ functions? If so, what is the mechanism?



Thanks in advance.

View 7 Replies View Related

Native Code: 25009 While Executing SQLCECommand

Feb 26, 2007

I'm getting this error while executing a SQLCECommand (ExecuteNonQuery):

Native Code: 25009
Massage: Unspecified error
HResult: 2147467259
Source: SQL Server 2005
Mobile Edition ADO.NET
Data Provider

This happens only sometimes. If I recreate the command object and executing it again (with the same connection object) no error occurs.

Except for this case the application works fine.



Thanks,

Laschek

View 1 Replies View Related

Using Native-code COM From Unsafe CLR Stored Procedure?

Sep 27, 2006

Hello, everyone.

I have to make a gateway to access third-party closed-source native-code COM objects. As an interface, SQL Server stored procedures are absolutely perfect for my needs. I decided to use SQL Server 2005 CLR rather than using deprecated extended stored procedures or accessing COM objects directly through SQL Server. (This decision is aided by the fact that the third party has plans to make a .NET version of their COM objects "really soon now" (i.e.: not soon enough). Backporting their new interface to my abstraction layer will be very simple.)

I'm having problems using these COM objects from my SQL Server 2005 CLR stored procedure. When I try to run my stored procedure, I get the error below. It appears that SQL Server/CLR refuses to perform the disk access necessary to load the COM object from disk so that it can instantiate it. (My message continues after the error.)

Msg 6522, Level 16, State 1, Procedure MyStoredProcedure, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'MyStoredProcedure':
System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at System.Activator.CreateComInstanceFrom(String assemblyName, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at System.Activator.CreateComInstanceFrom(String assemblyName, String typeName)
at UserDefinedFunctions.MyStoredProcedure()
.

I'll outline the steps I performed so far to get the assembly working:
Ensured I was running at SQL Server 2005 compatibility level. (90)
- Installed and configured the third-party COM objects on my devel box and my DB box. They registered themselves properly.
- Enabled CLR in the DB.
- Made sure the DB owner has UNSAFE ASSEMBLY permission.
- Added the TRUSTWORTHY property to the DB. (Yes, this isn't the "correct" way to do it, but I didn't want to deal with code-signing voodoo. Apologies to actual believers in voodoo.)
- Created an Unsafe assembly "MyAssembly" in SQL Server 2005 and Visual Studio 2005.
- Created all the necessary Interop assemblies (by creating a normal (non-SQL) C# project and building my code, and raiding the bin directory).
- Added these Interop assemblies to SQL Server 2005 as Unsafe assemblies.
- In VS2005, built my SQL Project code and deployed successfully.
- Tried running my stored procedure through a Query window, and I got the error above.

I've done many searches. All of the results I've found concern themselves with Web Services and XML serialization, and suggest using sgen.exe. I don't think they're relevant to my problem. A few said I should add my COM DLLs as assemblies to SQL Server, but that is impossible for native code DLLs. I found something that hinted at tblexp.exe, but I didn't understand how that could help me. I already figured out a way to get me the Interop libs.

Efforts at solving:
- Reading webpages for hours on end.
- I tried using sgen.exe to create the XML serialization assembly, but it didn't help.
- I tried adding various native-code DLLs directly as SQL Server assemblies, but you can bet it didn't like that.
- A few other pitiful attempts not worth mentioning.
- Reading this forum. I didn't see anything that applied.
- Posting here.

I really wish Microsoft had meant what they said when they stated that "Unsafe" assemblies can access anything, instead of trying to protect developers from their folly.

Any insights on getting those COM objects to work in my CLR stored procedure? Thank you.

-Tony Flay

View 3 Replies View Related

Failed OLEDB Connection: Cannot Aquire Connection From Connection Manager

Feb 6, 2008

I have a package that uses a for loop to iterate through an unknown amount of excel files and pull their data into a table. However, there will be cases when the file is corrupted or has some sort of problem so that either the transformation will fail or the excel data source will fail with an oledb connection error.
Could anyone suggest a clean way to trap these errors? Specifically, the "Cannot Aquire Connection from Connection Manager", which is the excel connection.

Thanks,

John T

View 3 Replies View Related

Way To Retrieve Actual Size Of Ntext Column In Native Code?

Aug 3, 2007

Howdy folks! (I feel im creating too many topics...but all my questions are unrelated :-/)

Dev environment: SSCE, Native c++ OLE code, Win CE 5

I have a routine that calculates the size of a set of columns in order to create a byte buffer for retrieving data from an IRowset and inserting it into a custom class. This method works great for all data types except ntext. When I look at the column information from an ntext field, the DBCOLUMNINFO::ulColumnSize member holds 536,870,911 (the max length of an ntext type). Obviously I dont want to allocate 1GB of memory for each ntext column. Is there anyway (natively) to determine the actual number of characters in a field?

View 12 Replies View Related

Can I Write A Dll(or Share The Same Code) That Works On Both Mobile Device And Pc?

May 4, 2007

hi,

Can I write a dll(or share the same code) that works on both Mobile device and pc? Since we are using compact edition, we are hoping we can write some common module with the same code that could works on both mobile device and pc platform. I noticed the reference is the same, System.Data.SqlServerCe.dll 3.0.

Another question is, we already have a module for SQLCE2.0, with .net CF1.0. Now, we will start to use compact edition, should we just update on the 1.0 one, or we have to write a different one based on .net CF2.0? Can I use compact edition in CF1.0 dll?



Thanks.

View 1 Replies View Related

Power Pivot :: Show Images In Power View With Power Query On Excel Desktop Version / Office 365

Aug 2, 2015

I am trying to show images in a product listing in power view.I work with an excel 2013 desktop version based on an office 365 pro account.I did the following steps:

import of an excel file with an article list via power query and loading the data to the data model import jpg images from a folder via power query, setting content as binary type and loading the data to the data modellinking both tables in power pivot--> manage via the image namesetting the table behavior for the images table under power pivot --> manage --> Advanced (e.g. Default Image: Content)opening power view and building article cards with article number and imageProblem: only a camera icon shows up in power view

Is there a solution with a desktop version?Can I use my Office 365 Pro account to make it work? How?Why is there no solution showing images in a pivot table?Link to Dropbox with power pivot filesĀ 

View 9 Replies View Related

Using Oledb Connection From Connection Manager In Script Task

Aug 9, 2006

Is there anyone who tried to use a connection from connection manager to create a new connection in a script task? Including the password?

Now i passed the connection to the script task and called it in the vb script but then the password is not passed into the connect string.

Im searching for an example that works with passing the password in the connectstring?



Any help will be greatfull.


View 1 Replies View Related

SQL Native: Connection Refused By Using IP

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

Configuring The Code Page Of A OLEDB Source.

Jun 25, 2007

hi,

i have a number of interfaces in which i have used oledb source.

the problem i am facing is oledb source components code page is not configurable now if i want to deploy the interface in a different environment which has a database with a different collation it gives a error that oledb source needs new metadata.

has anybody faced this problem earlier.please give me a solution to this problem ..

thanks in advance.

srikanth

View 1 Replies View Related

OLE DB Connection Fails; Native Client Does Not

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

Coneverting Oledb Code To Connect To Remote Sqlserver

Sep 28, 2007

i have some oledb code made in c#(vs 2005) it is for local msaccess file. i want to conevert the code for sql server where connection string placed in web.config file seperately. please help me.here is code private void buildGrid()
{
string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
conStr += Server.MapPath("~/common/db/demo.mdb");
System.Data.OleDb.OleDbConnection dbCon = new System.Data.OleDb.OleDbConnection(conStr);
dbCon.Open();

string sql = "SELECT * FROM Posts ORDER BY LastPostDate DESC";
System.Data.OleDb.OleDbDataAdapter dbAdapter = new System.Data.OleDb.OleDbDataAdapter(sql, dbCon);
DataSet ds = new DataSet();
dbAdapter.Fill(ds);
ds.Tables[0].TableName = "Inbox";

Grid1.DataSource = ds;
}

 
 
please healp me..

View 3 Replies View Related

OLEDB Command Transform Error Code: 0x80004005

Dec 20, 2007

I'm receiving an Error Code: 0x80004005 ... a "non-specific error" when trying to use a fairly simple insert in the oleDB command transform. SQL command works fine if I specify the parameters in the values clause of the INSERT statement. If however, I try to use the parameters in setting a variable, I get the 0x80004005 error. Is this a known issue/limitation, or am I just reallly doing something wrong?

View 4 Replies View Related

.Net 2003 Access Crystal Report XI: Error:Failed To Open The Connection: [Database Vendor Code: 17 ]

Sep 19, 2006

I am receving this error: Failed to open the connection: [Database Vendor Code: 17 ], from .Net 2003/C# to Crystal Report XI with SQL Server 2000 has backend database.

Is there a security permission that has been overlooked?

Here is the code I use to access CR XI

ConnectionInfo connectionInfo = new ConnectionInfo();
TableLogOnInfo tableLogOnInfo;
Database DB;
'CrystalDecisions.CrystalReports.Engine.Table' table;
Tables tables;

//Log in
connectionInfo.ServerName = "ServerName";
connectionInfo.DatabaseName = "Database Namet";
connectionInfo.UserID = "userid";
connectionInfo.Password = "password";

//Get Table inf from report
DB = reportDocument..Database;
tables = DB.Tables;


//Looping through all the tables in CR and apply connection info
for(int i = 0; i < tables.Count; i++)
{
table = tables[ i ];
tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);

}

CrystalReportViewer.ReportSource = ReportDocument.ReportSource;
CrystalReportViewer.Visible = true;

Any advise would be helpful.
Thank you

View 6 Replies View Related

Using The Same Connection In Multiple Threads -&&> Native Exception

Jan 24, 2006

I found a peculiar thing today while working with SQL Mobile in a multithreaded application (VS2005, application for Pocket PC 2003).

I created a class which has one SqlCeConnection object. Every time I call a function to insert/select/delete something from the local db, I open the connection, execute the query an then close the connection again.

But when I'm calling a function from the db class in thread 1 and in the meantime call a different function (from the same db class of course) in thread 2, things go wrong. Because when function 1 wants to close the connection, function 2 is still using the connection and it will crash my application with a native exception (0xC0000005: access violation).

I can see why the error is happening, but shouldn't there be a nice .NET handled exception instead of a native exception which grinds my app to a hold?

(A workaround I use now is to use multiple connection objects instead of one, but I thought I'd give this feedback anyway)

View 5 Replies View Related

SQL Native Client Connection String Problem

Oct 18, 2006

Hi,

I have two server instances of SQL on my server MYSRVR: default (SQL 2000) and named SQLX (SQL 2005).

I've been using these strings ok for the default (SQL 2000):

"Server=MYSRVR; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

"Server=192.168.1.128; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

and these for the named (SQL 2005)

"Server=MYSRVRSQLX; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

"Server=192.168.1.128SQLX; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

But then adding the SQL port 1433 works for the default:

"Server=MYSRVR,1433; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

"Server=192.168.1.128,1433; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

But this, for named (SQL 2005) actually connects to default. The SQL port is causing the name SQLX to be ignored.

"Server=MYSRVRSQLX,1433; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

"Server=192.168.1.128SQLX,1433; Database=mydb; Network=dbmssocn; Integrated Security=SSPI "

Anyone any ideas?



View 5 Replies View Related

Oledb Source Adapter Exception Error Code: 0x80040E21

Feb 9, 2006

Hi
I am using Oledb Provider for Db2 from IBM. (There is another one from microsoft)
Through this provider I am constructing a oledb connection manager.

This connection manager I am Using in Oledb Source adapter.
Now when I set Data Access mode as Table or view I Am able to preview the data.

But when I use Data Access Mode as SQL Command try to preview I get this Error


TITLE: Microsoft Visual Studio
------------------------------
Error at s_NEWMAPPING10 [EMP [1]]: An OLE DB error has occurred. Error code: 0x80040E21.
------------------------------
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------
BUTTONS:
OK
------------------------------

I am not able to figure out how to resolve this.

View 3 Replies View Related

Remote Connection From Mobile Device...?

Jun 5, 2006

Hello,



I try to connect the SQL Server from the mobile device.

my connection string is:

string conn_str = "Server= 10.0.0.11;Database=theDB005;uid=bahadir;pwd=abcd;Trusted_Connection=false;";

when i try to open the connection I get SqlException,altough the 10.0.0.11 machine is reachable.. is not allowed to access a remote sql server with ip?



Thanks in advance.

View 1 Replies View Related

Connection Path OK On Device, Not On Desktop

Oct 3, 2007

This code...

string Path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
// Create the connection fConnection = new SqlCeConnection("Data Source ="" + Path + "\TreeNotes.sdf" ;Password ="abcd1234";");
fConnection.Open();

...works on my device, but on my computer it gives SqlCeException with message:
The database file cannot be found. Check the path to the database. [ File name = Program FilesTreeNotesTreeNotes.sdf ]

I've tried all sorts of things, but the computer just can't find the database. I've even tried putting a copy of the database into...
C:Program FilesTreeNotesTreeNotes.sdf...hoping that the computer will find it there.

What am I missing?

View 12 Replies View Related







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