sql-server-ce

Select newly added Row - DataGridView and BindingSource

I'm adding a new Row to a BindingSource that is Bound to a DataGridView source.AddNew(); After this, use BindingSource to get the newly added row is return the next row in the DataGridView when its sorted. ROW "A" ROW "B" <- myBindingSource.AddNew(); ROW "C" myBindingSource.Current gives ROW "C". (it became the selected row in the ...

Retreving an image stored on SQl Server CE 3.1

Hello! I'm developing a WinForm app for Windows Mobile 6.0 with C#, .NET Compact Framework 2.0 SP2 and SqlServer CE 3.1. I have this code that is not working: using (SqlCeDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { //read the signature from the database long imgSize = reader.GetBytes(0, 0, n...

SQL Server CE nvarchar foreign keys with trailing whitespace

In SQL Server CE, foreign key constraints on nvarchar fields are only enforced after dropping the trailing whitespace. This means that if the PK is "foo " I can insert "foo" into the FK. Why is this the case? It seems to badly undermine the data integrity the foreign key system is supposed to provide. Is there any way to enforce a forei...

Backup and Restore a SQLCE .sdf database

My application needs to backup and restore .sdf files. There is a single dataSet the the whole application and some bindngSource and table adapters on forms using this same dataset. Just for a sake of test I tryied to copy the .sdf in runtime for a backup folder and back to restore it and I got my application not finding the file like i...

SQL Compact import DB from SQL Server Express with Server Management Studio

Hi! I try to import sql script, generated with Server Management Studio, into SQL Compact 3.5 and get a lot of error. What I am doing wrong? I generate script with "Task/Generate Script" context menu. Part of my script: CREATE TABLE [LogMagazines]( [IdUser] [int] NOT NULL, [Text] [nvarchar](500) NULL, [TypeLog] [int] NOT NULL, [Date...

SQL Compact - Hang on invalid file

I use Linq to Sql Compact with code generated by sqlmetal. When I open an invalid database, like eg an mp3, I can create the DataContext without getting an Exception. But when I query any data or call DatabaseExists, the application hangs. Why is no exception thrown? Is this a known problem? ...

what is the fast way for find data in sqlCE - windows mobile & C#

hi what is the fast way to find and data in sqlCE in windows-mobile (C#) ? i have database with 1000000 records. sql query ? .... or data reader ?.....or wat ?? thank's in advance ...

Is the Unicode prefix N still needed in SQL Compact Edition?

At least in previous versions of SQL Server, you had to prefix Unicode string constants with an "N" to make them be treated as Unicode. Thus, select foo from bar where fizz = N'buzz' (See "Server-Side Programming with Unicode" for SQL Server 2005 "from the horse's mouth" documentation.) We have an application that is using SQL Compac...

Sql Server Compact Edition 3.5: Does the data persist in the database file?

Hi guys, I have this question in which I have a SQL Server Compact Edition database for a desktop application. I am completely new to Sql Server Compact Edition. The question is, does the data inserted in the database persist even if the application is shut down or restarted? Coz I cant seem to find my data when using Sql Server Manageme...

Support for compact framework in subsonic 3.0?

I was wondering when support for compact framework and sql server compact edition will be added to the Subsonic 3.0 project? ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I'm not crazy about having this dependency on SQL Express and would prefer to use a small file-based database. My problem is that I am using Entity Framework. I have ...

Looking for tool that can see tables and data in sqlCE - in computer that isnt have Visual studio or SQL server

i am Looking for tool that i can see tables and data in sqlCE - in computer that isn't have Visual studio or SQL server install on them ...

add row to a BindingSource gives different autoincrement value from whats saved into DB

I have a DataGridView that shows list of records and when I hit a insert button, a form should add a new record, edit its values and save it. I have a BindingSource bound to a DataGridView. I pass is as a parameter to a NEW RECORD form so // When the form opens it add a new row and de DataGridView display this new record at this time D...

LINQ-to-SQL and SQL Compact - database file sharing problem

Hello. I'm learing LINQ-to-SQL right now and i have wrote a simple application that define SQL data: [Table( Name = "items" )] public class Item { [ Column( IsPrimaryKey = true, IsDbGenerated = true ) ] public int Id; [ Column ] public string Name; } I have launched 2 copy of application connected to the same ...

Open Connection to SQL Compact File, with other Extension than .sdf

I just can't open this connection, if the Extension is different than .sdf. It's there a workaround (Please do not suggest, changing the extension of the File temporarily) ? Thnk u very much. Javier ...

SQLCe connection error 0x80004005

Hello. I get the error when i'm trying to open a database in PocketPC emulator or from the program with connection's Open() method(C#)..Here it is: Description: Internal error: SQL Server Compact made an unsupported request to the host operating system. Can someone explain what can cause this error to appear. The database and applicati...

How do I free SQLServerCE's COM instance from the current running process?

It's been a while since I touched COM so be nice ;) This is under WindowsCE 5.0 with SQLServerCE 2.0. After calling this to load SQLServerCE 2.0 : - IDBInitialize *pIDBInitialize = NULL; CoCreateInstance(CLSID_SQLSERVERCE_2_0, NULL, CLSCTX_INPROC_SERVER, IID_IDBInitialize, (void**)&pIDBInitialize); Module load occurs for SSCE20.dll w...

SQLCE 3.5 FIPS compliance on Windows Mobile 6.0

What is the position of SQLCE 3.5 when running on Windows Mobile 6.0 in relation to FIPS compliance. I have read lots of differing reports on this and need a definitive answer, one which comes from a reliable source (please provide links) I have read this "The encryption modes in SQL Server Compact 3.5 are FIPS complaint if FIPS mode i...

SQLServerCE Problem with parameterized queries from .NET

Hello, I am pulling the hair out of my head trying to figure this one out. I can't make Parameterized queries to work in VB.Net, when I am using parameters. From what I have found, using a parameter in a function, from .NET raises an error (see sample code). However, running the not working query in the Query Window in Visual studio w...

Where do I find some tutorial through using SQL Server Compact 2008 in Visual Studio C# 2008 Express Edition?

Hi, I've been searching for half a day for some tutorial or walkthrough the SQL server compact 2008 usage in the C# code. I have never used any sort of database in C#/studio yet. Where am I supposed to get this info, please? ...