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


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

SQL Compact 3.5 Database Opening on Windows Vista - Unhandled Exception

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server
 

I have written a Visual Basic 2008 application that utilizes SQL Server Compact Edition 3.5. On my Vista (32-Bit) development machine, I can install this application and have it connect to my SQLCE Database just fine. However, if I deploy the application to any other Vista computer (32-Bit or 64-Bit), I get the following error message when trying to connect to the database.

 

Unhandled exception has occured in your application.....

 

Opening a database as read-only requires a temp path to be specififed. [Db name = C:\users\bob\Documents\MyDatabase.sdf ]

 

The users who are running the application are in the local machine Administrators group. Running the application "As Administrator" does not resolve the issue.

 

I've used various connection strings suggested in other threads with no luck. The one I'm currently working with is:

 

Data Source=C:\users\bob\Documents\MyDatabase.sdf;File Mode=Read Only;Temp Path=%TEMP%;

 

Does anyone have any suggestions?

 

Thanks!




View Complete Post


More Related Resource Links

Unhandled exception in XAML editor from control that accesses database. - "System.Data.SqlServerCe.S

  

Hello,

Im having a bit of difficulty with some WPF/C#/SQL Server CE code.

I have a WPF User Control with the following line of code in the constructor:

MyDatabase database = new
 MyDatabase("Data Source=|DataDirectory|\\MyDatabase.sdf"
 );

where MyDatabase is a class generated using SQLMetal.exe from MyDatabase.sdf.

 

When I added this control to other controls, the application runs fine and I'm able to access my database. When I try to edit these parent controls,  the XAML editor throws the following error:

 

>System.Data.SqlServerCe.SqlCeException
>The database file cannot be found. Check the path to the database. [ Data Source = D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MyDatabase.sdf ]

 

Why does the XAML editor redirect my DataDirectory to "D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\" and why does the XAML editor execute my database access code?

 

How can I fix this so I can use this control in a XAML editor?

Thanks,

Greg S.

 


Unhandled exception in XAML editor from control that accesses database. - "System.Data.SqlServerCe.S

  

Hello,

Im having a bit of difficulty with some WPF/C#/SQL Server CE code.

I have a WPF User Control with the following line of code in the constructor:

MyDatabase database = new
 MyDatabase("Data Source=|DataDirectory|\\MyDatabase.sdf"
 );

where MyDatabase is a class generated using SQLMetal.exe from MyDatabase.sdf.

 

When I added this control to other controls, the application runs fine and I'm able to access my database. When I try to edit these parent controls,  the XAML editor throws the following error:

 

>System.Data.SqlServerCe.SqlCeException
>The database file cannot be found. Check the path to the database. [ Data Source = D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MyDatabase.sdf ]

 

Why does the XAML editor redirect my DataDirectory to "D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\" and why does the XAML editor execute my database access code?

 

How can I fix this so I can use this control in a XAML editor?

Thanks,

Greg S.

 


Microsoft SQL SERVER 2005 COMPACT EDITION FOR WINDOWS VISTA HOME PREMIUM EDITION 32BIT

  
MY WINDOWS LIVE PHOTO GALLERY HAS STOPPED WORKING. I GET A MESSAGE SAYING TO GO TO MICROSOFT DOWNLOAD CENTER TO INSTALL MICROSOFT SQL SERVER COMPACT EDITION .WHEN I CLICK DOWNLOAD IT TELLS ME TO INCERT DISK.I DON'T HAVE A DISK WHAT CAN I DO ? PLEASE HELP !!! :=(

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

  
Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

Visual Studio closes itself by opening aspx-Page designer after Windows Update

  

Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.


Thanks

Nik


Data Points: Windows Azure Table Storage - Not Your Father's Database

  

Let go of your traditional relational database thinking if you want to understand how Windows Azure Table storage works, says Julie Lerman. Luckily for you, she's done the hard work to grasp the new concepts and help you get up to speed.

Julie Lerman

MSDN Magazine July 2010


CLR Inside Out: Unhandled Exception Processing In The CLR

  

In this installment of CLR Inside Out Gaurav Khanna explains everything you need to know about unhandled exception processing in the .NET Framework.

Gaurav Khanna

MSDN Magazine September 2008


Windows with C++: Decoding Windows Vista Icons with WIC

  

In this month's installment, Kenny Kerr sings the praises of the new Visual C++ 2008 Feature Pack, which brings modern conveniences to Visual C++.

Kenny Kerr

MSDN Magazine June 2008


.NET Matters: IFileOperation in Windows Vista

  

The author creates a managed wrapper to use the new IFileOperations interface in Windows Vista from managed code.

Stephen Toub

MSDN Magazine December 2007


Gadgets: Build Your Own Windows Vista Sidebar Gadget

  

A Sidebar gadget is a powerful little too that's surprisingly easy to create. Get in on the fun with Donavon West.

Donavon West

MSDN Magazine August 2007


Windows with C++: Windows Vista Control Enhancements

  

With the release of Windows Vista, C++ developers will be happy to know there's plenty of magic left to perform. This new column will provide the necessary insight.

Kenny Kerr

MSDN Magazine August 2007


Security: Applying Cryptography Using The CNG API In Windows Vista

  

Cryptography Next Generation (CNG) is meant to be a long-term replacement for the CryptoAPI, providing replacements for all of the cryptographic primitives it offered.

Kenny Kerr

MSDN Magazine July 2007


CONCURRENCY: Synchronization Primitives New To Windows Vista

  

Windows Vista has lots of goodies for native C++ developers including condition variables, slim reader/writer locks, and one-time initialization.

Robert Saccone and Alexander Taskov

MSDN Magazine June 2007


Least Privilege: Teach Your Apps To Play Nicely With Windows Vista User Account Control

  

User Account Control in Windows Vista keeps the OS safe from intentional and accidental configuration changes.

Chris Corio

MSDN Magazine January 2007


Desktop Security: Create Custom Login Experiences With Credential Providers For Windows Vista

  

Why is a change to the Windows logon plug-in interface so exciting? Because with credential providers you can customize the logon experience for your users.

Dan Griffin

MSDN Magazine January 2007


Categories: 
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