sql-server-ce

Moving data from SQL Compact to SQL Server 2008

╄→гoц情女王★ 提交于 2019-12-23 03:28:10
问题 I have created an .SDF file and inserted data into the SDF database file on a mobile device. I want to transform .SDF file to a SQL Server 2008 Database File but don't know how. Any pointers or suggestions would be appreciated. 回答1: You cannot directly convert a SQL Compact database into a full SQL Server 2008 database, as they are structured completely different. And as far as I know you cannot use SSIS (SQL Server Integration Services) to copy data from the SQL Compact database to a SQL

Difference between Bin/Debug and Bin/Release

断了今生、忘了曾经 提交于 2019-12-23 02:28:43
问题 I using a sql-server compact database within a c# winform project. If I look at the files that make up the solution I can see a copy of the exe and the sdf file in both of the following folders: /bin/Debug/ /bin/Release/ If I double-click and exe in 1. then it updates the sdf in 1. and likewise for the exe/sdf in 2. When I open VS I assume I'm playing around with the files in 1. ? When do the files in 2. get overwritten ? When I publish the project using a Click-Once install which files are

Using SMO to script PARTIAL data content (only rows matching a WHERE clause)

≡放荡痞女 提交于 2019-12-23 02:18:56
问题 I use SMO to fill a SQL Compact database with the data of a SQL server database. Here is the code I actually use: foreach(Table l_tblCurrent in l_dbDatabase.Tables) { if(l_tblCurrent.IsSystemObject) continue; ScriptingOptions l_scOptions = new ScriptingOptions(); l_scOptions.NoIdentities = true; l_scOptions.NoCollation = true; l_scOptions.NoCommandTerminator = true; l_scOptions.NoFileGroup = true; l_scOptions.ScriptSchema = true; l_scOptions.ScriptData = true; foreach(string l_strCurrent in l

Cannot save to database or retrieve (right info) from it

夙愿已清 提交于 2019-12-22 18:21:44
问题 I am saving data to the database "successfully", using: try { // Save the new Client now. Profile profile = new Profile() { Salutation = Salutation, FirstName = FirstName, MiddleName = MiddleName, LastName = LastName, Gender = Gender, DateOfBirth = DateOfBirth, CompanyName = ClientCompanyName, StreetAddress = StreetAddress, Suburb = Suburb, PostCode = PostCode, State = State, Country = Country, ABN = ABN.ToString(), ACN = ACN.ToString(), TelephoneNumber = TelephoneNumber, MobileNumber =

Inserting all rows of a DataTable into a SQL Server table, including Id values

别说谁变了你拦得住时间么 提交于 2019-12-22 17:41:13
问题 I'm trying to insert the contents of a DataTable verbatim into a SQL Server database using ADO.NET. (Note: I'm using SQL Server CE at the moment, but I'd like a solution that works in either regular or CE.) Using the following code results in a command that does not include the Id column: var builder = new SqlCeCommandBuilder(); builder.DataAdapter = adapter; builder.SetAllValues = true; var command = builder.GetInsertCommand(true); This causes the Id to be auto-generated, which is not what I

How do I join two tables with different column in SQL Server CE?

时间秒杀一切 提交于 2019-12-22 14:56:10
问题 How can I joining two tables with different column in SQL Server CE? I have two tables: Table Schedule +-----+----------+------+ + ID + Name + Type + +-----+----------+------+ + 1 + A + 1 + + 2 + B + 1 + + 3 + C + 2 + +-----+----------+------+ Table Description +-----+--------------------+ + ID + Description + +-----+--------------------+ + 1 + A1 - XXXXX + +-----+--------------------+ And what I want to get is the table like: +-----+----------+-----------------+ + ID + Name + Description + +

Converting SQL Server database to local C# database

时光怂恿深爱的人放手 提交于 2019-12-22 08:41:24
问题 I have created program that uses SQL Server database to store data. After a while (and lots of stored data) I have realized I don't need database on the server, local database running without server could do the job. Now I need some advice how to export, convert or whatever, SQL Server database to local (sdf) database? I'm using VS 2010 and SQL Server 2008, I also have SQL Server Management Studio. 回答1: Check out the SQL Server to SQL Server Compact Edition Copy Tool available on CodeProject

Inserting into SQL Server CE database file and return inserted id

♀尐吖头ヾ 提交于 2019-12-22 08:39:15
问题 Problem is : My query INSERT INTO TableName(val1,val2)values(1,2); SELECT @@IDENTITY; When I run it in run query from server explorer I get the correct result. But when I use ExecuteScalar or ExecuteDataTable I get an error ,... query return null public object ExecuteScalre(string Query, CommandType type) { OpenConnection(); cmd.CommandText = Query; cmd.CommandType = type; object obj = null; try { obj = cmd.ExecuteScalar(); } catch { } finally { ReleaseResource(); } return obj; } public

The best way to check if SQL CE is installed, and if so what version?

谁说我不能喝 提交于 2019-12-22 08:27:00
问题 I've written a VB.NET application that uses SQL CE 3.5. I'm curious if anyone has any best practice or code to help check if A) SQL CE is installed and B) If so, what version. I searched msdn and google for anything but I didn't find anything helpful. I was poking around the registry and found this key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5 with a string value "Version" and the data was 3.5.5692.0. So off the bat my assumption is to check for the

How do I efficiently store all OpenStreetMap data in an indexed way?

只谈情不闲聊 提交于 2019-12-22 06:49:55
问题 Note: While I target Windows Phone 7, it doesn't introduce anything besides a size restriction. In an attempt to write a GPS / Routing / Map application for the Windows Phone 7, I'm trying to attempt to use OpenStreetMap for this and I want to get my data stored in a SQL Server Compact Edition database on my Windows Phone 7. This is giving me a lot of trouble so I'm getting clueless what the right way is... Here is my progress: I've downloaded Belgium.osm.pbf, which contains all the Belgium