sql-server-ce

Webmatrix 3 Sql Server CE 4 Busted?

删除回忆录丶 提交于 2019-12-10 22:13:50
问题 Ok, when I create a sql server CE .sdf database in the new Webmatrix 3 I run into a problem. I've narrowed an example down to this. 1) I create a table called test. One column "test_ID" is a bigint, primarykey, and an identity. 2) I create another column called "test_desc" which is a nvarchar(50) with all the defaults. Problem. I cannot insert data using the GUI. Something about the column name cannot be modified. This is very annoying and somewhat disappointing for a new release to have such

There was an error parsing the query SQL Server CE / VS 2010 local database

时光总嘲笑我的痴心妄想 提交于 2019-12-10 21:27:13
问题 I wrote an little app in C# to keep track of customers and jobs but I get an error "There was an error parsing the query.[Token line number = 1, Token line offset = 38,Token in error = Name] I'm using a SQL Server CE .sdf database public static List<string> ListDates(string clientname) { List<string> date = new List<string>(); string myName = clientname; using (SqlCeCommand cmd = conn.CreateCommand()) { conn.Open(); cmd.CommandText = @"SELECT * FROM FarmJobs WHERE Name = ?Name;"; cmd

Sql CE Inconsistent with Multiple Statements

本小妞迷上赌 提交于 2019-12-10 21:25:06
问题 It has long been true that you can execute multiple statements with SQL CE. And in fact I'm using SQL Server Compact Toolbox to do exactly that. But when I take the same multiple-statement commands and execute them from Dapper... public const string SampleDml = @" INSERT INTO [Plugin](Name, TypeName) VALUES ('Blog','Shroom.Blog'); GO INSERT INTO [ContentDef](PluginID, Name, Placement, IsStatic) VALUES(@@IDENTITY,'MyBlog','Layout:Left',1); GO "; I then keep getting this error: There was an

Windows CE 6.0 - Installing SQL Server CE 3.5 into the run-time image

百般思念 提交于 2019-12-10 20:15:04
问题 I made an application that I put onto the hard disk of Win CE (the Compact Flash card). My problem is that the application is using the SQL Server CE 3.5 database but it looks like that the image is created with the SQL Server CE 3.0. I couldn't select the 3.5 version when I started to build the image. The 3.5 version dlls are deployed every time I debug the application so the problem never shows up in the development phase. Now when the application starts (it is started automatically when OS

Is there a way to search the fields of all tables at once, in SQL Server CE?

时光怂恿深爱的人放手 提交于 2019-12-10 18:33:55
问题 I was hoping that within the WebMatrix (C#.net) environment (using SQL Server Compact) that there was a way to search all tables and fields for a value. I have a bunch (like 100) of tables, connected to via WebMatrix and I am trying to look for a table that holds some information I need. I have been here: http://blogs.thesitedoctor.co.uk/tim/2007/11/02/How+To+Search+Every+Table+And+Field+In+A+SQL+Server+Database.aspx And here, on stackoverflow: search all tables, all columns for a specific

Where is the SQL Server Compact file?

半世苍凉 提交于 2019-12-10 18:20:07
问题 I have an ASP.NET MVC project that uses a SQL Server Compact database. I have the following connection string for my FoobarContext : <add name="FoobarContext" connectionString="Data Source=|DataDirectory|Foobar.sdf" providerName="System.Data.SqlServerCe.4.0"/> I fired up the project and it appears to persist data as expected. However, I can't find a file named 'Foobar.sdf' anywhere. What am I missing? Update: It wasn't taking my connection string. Setting a breakpoint and inspecting the

How to use local database .sdf in c# wpf?

不打扰是莪最后的温柔 提交于 2019-12-10 18:17:54
问题 I am trying to make a database application. I added local database from add > new item > local database.sdf In Server Explorer, I created a table in the database. But I am having trouble connecting to it. I want to show all the data in a DataGrid. My code: string ConnectionString = @"Data Source=""c:\users\asus\documents\visual studio 2012\Projects\WpfApplicationLocalDB\WpfApplicationLocalDB\LocalDB.sdf"""; SqlConnection conn = new SqlConnection(ConnectionString); conn.Open(); SqlDataAdapter

SQL Server Compact does not support calls to HasRows property if the underlying cursor is not scrollable."

为君一笑 提交于 2019-12-10 17:24:03
问题 What does this actually mean? I am stepping through some code and when I look at the properties of my datareader under the locals window in vs2010, the DR.HasRows shows an error: HasRows '(DR).HasRows' threw an exception of type 'System.InvalidOperationException' bool {System.InvalidOperationException} base {"SQL Server Compact does not support calls to HasRows property if the underlying cursor is not scrollable."} System.SystemException {System.InvalidOperationException} WHat is a cursor and

SQL Server Compact Edition 4.0: Error: 26 - Error Locating Server/Instance Specified

时光毁灭记忆、已成空白 提交于 2019-12-10 17:04:31
问题 I have been developing a console application (C# / .Net Framework 4.0 / VS2012). I created a SQL Server Compact database ( *.sdf ) and added a connection string as: <connectionStrings> <add name="Dispatcher.Properties.Settings.FakeDataSetConnectionString" connectionString="Data Source=|DataDirectory|\FakeDataSet.sdf" providerName="Microsoft.SqlServerCe.Client.4.0" /> </connectionStrings> But When I'm trying to execute the following code: SqlConnection con = new SqlConnection(); con

C# SQL Server CE not inserting

僤鯓⒐⒋嵵緔 提交于 2019-12-10 12:31:31
问题 SqlCeConnection sqlCnn = new SqlCeConnection(Properties.Settings.Default.mainDBConnectionString); SqlCeCommand sqlCmd = new SqlCeCommand( "INSERT INTO desktopItems (Location,Label) VALUES (@Location, @Label)", sqlCnn); sqlCnn.Open(); sqlCmd.Parameters.Add("@Location", openExe.FileName.ToString()); sqlCmd.Parameters.Add("@Label", openExe.SafeFileName.ToString()); sqlCmd.ExecuteNonQuery(); sqlCnn.Close(); I have this code but when I run the program, the database is not updating ... 回答1: Usually