sql-server-ce

How can a SQL Server CE database be simultaneously connectable and un-?

那年仲夏 提交于 2019-12-02 11:37:39
I have a SQL Server CE database in my Windows CE app. I can see it (HHS.sdf) in my project in Server Explorer: ...but the Columns folders for the tables won't expand; clicking them gives me: The path property for HHS.sdf reads: Data Source=Mobile Device\Program Files\hhs\HHS.sdf If the path is not valid, why is Server Explorer showing me the database at all? If I create a new connection in Server Explorer (by selecting "Add Connection..." from the Data Connections context menu), I can navigate to the .SDF file on the device (\Program Files\hhs), test the connection in the "Add Connection"

“Error parsing the query” while getting @@Identity from SQL Server CE

孤者浪人 提交于 2019-12-02 09:54:26
I'm writing a simple desktop application in which I'm using a local SQL database (SQL Server CE). Here is the problematic section: SqlCeConnection conn = new SqlCeConnection("Data Source=|DataDirectory|\\App_Data\\Rosters.sdf"); System.Data.SqlServerCe.SqlCeCommand cmd = new SqlCeCommand(); cmd.Connection = conn; cmd.CommandText = String.Format("Insert into Teams (LeagueID, TeamName, Color) values ({0},'{1}','{2}');SELECT @@IDENTITY;", leagueID, txtTeamName.Text.Replace("'", "''"), txtColor.Text.Replace("'", "''")); conn.Open(); int teamID = (int)cmd.ExecuteScalar(); conn.Close(); The problem

can i connect to a remote SQLCe database?

◇◆丶佛笑我妖孽 提交于 2019-12-02 08:56:14
We've got an SQL Ce database on a remote machine and we're trying to get a reporting system (using custom LINQ queries) via c# to connect to the database in shared read mode. At this point we're getting an exception "There is a file sharing violation", even when the database has no other conections. Our sql connection string appears thus: using (SqlCeConnection conn = new SqlCeConnection( "Data Source=\\\\telemetry\\C$\\users\\usermetrics.sdf; File Mode=shared read;)) { conn.Open( ); // => exception here ... Is this even possible? 来源: https://stackoverflow.com/questions/7249510/can-i-connect

Create firebird data source in Visual Studio

我怕爱的太早我们不能终老 提交于 2019-12-02 08:52:24
I have an app in c# using Visual Studio 2010 express and realized the sqlce database i was using does not meet all of our needs. I am trying to figure out how to add a firebird datasource and point to my firebird database. I want to mimic the sqlce dataset creating a new dataset but with designer. I think my first step needs to be getting the data source added but I can't figure out how to do it. Any ideas? I tried following this article: http://www.ibprovider.com/eng/documentation/firebird_adonet/p2_visual_studio_2008.html#server_explorer as well as additional links within this article but

How can I select what columns come in from a DataSet into a DataTable?

老子叫甜甜 提交于 2019-12-02 08:42:40
Being new to working with Data, I hope I'm asking this properly. How can I select what columns come in from a DataSet into a DataTable? I know I can fill a DataTable by using... DataTable table = dataSet1.Tables[0]; but this brings in all the columns. How can I fill a DataTable with only certain columns? I'm using .NET 3.5, C#, and a SQL CE 3.5 single table database. Thanks. // Assumes that connection is a valid SqlConnection object. string queryString = "SELECT CustomerID, CompanyName FROM dbo.Customers"; SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection); DataSet customers

Insert many rows to one table OR insert rows separately to many table?

混江龙づ霸主 提交于 2019-12-02 08:22:26
I have two DataBase Table (SQL CE). A Teacher table and a A Class table. The two tables have One-to-Many relationship where one teacher has many classes (i.e. Class has a foreign key teacher_id ). Number of teachers (rows) is inserted (or generated) through C# code in run time, so as classes Which of the following is faster in INSERT and SELECT? Each time a new teacher is INSERTed, a new Class Table is created (e.g. Class_teacher001) to store whichever classes the teacher has. In this case, each Class Table doesn't have to be so large and foreign key is not needed because table name would

Why is this SQL Update failing (“column name is not valid”)?

女生的网名这么多〃 提交于 2019-12-02 08:20:09
I've got a SQL Server CE table like so: ...and I'm trying to update its solitary record like so: update workTables set fileType = "INV" Yet I get: Why? UPDATE Please see a related question here Your query should be: update [workTables] set [fileType] = 'INV' Note: single quotes ^^^^ Here check Microsoft support for yor error. http://support.microsoft.com/kb/825392 This is from the site: SYMPTOMS: When you run a query on a Microsoft SQL Server 2000 Windows CE Edition version 2.0 database, and the query has a column that contains one or more space characters, the query may not be successful.

How can I query a MS SQL Compact Server 3.5 database in C++ not using the OLE DB API?

﹥>﹥吖頭↗ 提交于 2019-12-02 06:45:42
问题 I have the dlls and the include files of MS SQL Compact Server 3.5. How can I use it without OLE DB? I just want to load the dlls and invoke the necessary methods myself, no COM please. Does anyone know the API? EDIT If this is not possible is there a fully functional example in C++ demonstrating accessing a database using the MSSQL Compact Server edition? 回答1: I do not think that is possible - http://msdn.microsoft.com/en-US/library/ms174579(v=SQL.90).aspx - an OLEDB sample is available here

Bulk insert from DataTable to SQLCE DataSource

只谈情不闲聊 提交于 2019-12-02 06:14:33
问题 This an C# WPF application with SQL CE as DataSource: I have a DataTable (display as DataGrid) and a SQL CE DataSource. I populate my DataTable from SQL CE using DataAdapter, DataSet and DataTable. Then bind my DataGrid to the DataTable. I may add rows (>10,000) rows to my DataTable and may have data edited before propagating all my changes all together to my Sql CE DataSource. My current approach is DROP TABLE, CREATE TABLE, and re-INSERT rows by brute force to SQLCE. SQL CE has no bulk

Sql Server CE 4 and EF 4.1 CF Win 64 bit deployment

拥有回忆 提交于 2019-12-02 06:08:17
Hi I have a following problem. I've created a project in 32 bit operating system. There I have installed EF 4.1 and SQL CE 4 for 32 bit. I've created a test table and launched it. Everything works, i.e. there is a connection to db and CRUD operations happen. In the reference pane I've set the copy local property for binaries EntityFramework.dll , System.Data.SqlServerCe.dll and System.Data.SqlServerCe.Entity.dll to true. Then I copy pasted the project into machine with x64 OS. It gives me the following error: Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture