sql-server-ce

how to open *.sdf files?

徘徊边缘 提交于 2019-12-17 17:25:16
问题 I used to open sdf (sqlCE) files with visual-studio? or sql-server? I really don't remember. Now I can't open this sdf file. With what program do I need to open it? 回答1: It's a SQL Compact database. You need to define what you mean by "Open". You can open it via code with the SqlCeConnection so you can write your own tool/app to access it. Visual Studio can also open the files directly if was created with the right version of SQL Compact. There are also some third-party tools for manipulating

C#/SQL - What's wrong with SqlDbType.Xml in procedures?

非 Y 不嫁゛ 提交于 2019-12-17 17:05:27
问题 I've asked few people why using xml as a parameter in stored procedure doesn't work and everyone said , that's just the way it is. I can't belive that. command.Parameters.Add("@xmldoc", SqlDbType.Xml); That's where compiler returns error and I can't use NVarChar beacouse it's limiteed to 4k sings. XML would be perfect as it can be 2gigs big. How come other SqlDbTypes work well and this one retruns error ? * Error: Specified argument was out of the range of valid values. Parameter name:

Profiler for Sql CE

梦想与她 提交于 2019-12-17 16:33:42
问题 i wonder if there is something similar to Sql Profiler for Sql Server Compact Edition? i use SqlCE as backend for a desktop application and it would be really great to have something like sql profiler for this embedded database. or at least something simliar to the NHibernate show_sql feature... any ideas? thanks j. 回答1: The only tested solution I know of that could solve this problem is Altiris Profiler which is a tool I designed at my previous job, but is closed source and not-for-sale. The

How to do Sql Server CE table update from another table

妖精的绣舞 提交于 2019-12-17 14:01:39
问题 I have this sql: UPDATE JOBMAKE SET WIP_STATUS='10sched1' WHERE JBT_TYPE IN (SELECT JBT_TYPE FROM JOBVISIT WHERE JVST_ID = 21) AND JOB_NUMBER IN (SELECT JOB_NUMBER FROM JOBVISIT WHERE JVST_ID = 21) It works until I turn it into a parameterised query: UPDATE JOBMAKE SET WIP_STATUS='10sched1' WHERE JBT_TYPE IN (SELECT JBT_TYPE FROM JOBVISIT WHERE JVST_ID = @jvst_id) AND JOB_NUMBER IN (SELECT JOB_NUMBER FROM JOBVISIT WHERE JVST_ID = @jvst_id) Duplicated parameter names are not allowed. [

How do I read the current path of |DataDirectory| from config settings

孤街浪徒 提交于 2019-12-17 13:22:34
问题 I'm writing a program that requires the user to select the active database at application startup. I have a Windows Form that will list the databases stored in a sub-folder of ApplicationData specifically for storing the database files. When I create a new database, however, I need to copy the the template database, but can't figure out where it's stored by default. I've tried: dpath = ConfigurationManager.AppSettings["DataDirectory"]; I always seem to get a null value in return though. At

How can I update a cell value in a dB table, using SQL Server CE and C# (Visual Studio 2010)

浪子不回头ぞ 提交于 2019-12-17 06:57:55
问题 I'm writing a small application for college, a video rental application. I have no problems reading from the database, but I cannot update the data in the tables. In particular I'm looking to update the cell showing the quantity of a film in stock after someone rents a movie. So far I've been trying this: string updateDVDs = "UPDATE Products SET dvd_quantity = " + product.Quantity + " WHERE title = '"+ product.Name +"';"; cmdUpdateDVDs = new SqlCeCommand(updateDVDs, dBConnection);

Whats wrong with this SQLCe Query?

帅比萌擦擦* 提交于 2019-12-14 02:12:58
问题 in the past hour i have been trying different variants of this query but i get error at the username , and the username is just a normal string with username that i get from xml file containing no special characters or whatsoever I'm using SLQ compact 3.5 P.S i tried to use ? instead of @username also not working all feilds are "nchar" except "date" C = nodeItem["user_from"].InnerText; avatar = nodeItem["user_from_avatar"].InnerText; string msgText = nodeItem["message"].InnerText; DateTime dt

How can I Retrieve a List of All Table Names from a SQL Server CE database?

霸气de小男生 提交于 2019-12-13 21:07:00
问题 Is there some SQL that will either return a list of table names or (to cut to the chase) that would return a boolean as to whether a tablename with a certain pattern exists? Specifically, I need to know if there is a table in the database named INV[Bla] such as INVclay , INVcherri , INVkelvin , INVmorgan , INVgrandFunk , INVgobbledygook , INV2468WhoDoWeAppreciate , etc. (the INV part is what I'm looking for; the remainder of the table name could be almost anything). IOW, can "wildcards" be

How can I get individual results in SQL Server CE

我的未来我决定 提交于 2019-12-13 18:14:44
问题 I'm using SQL Server CE as my database with asp.net. I'm querying the database as follows. SELECT DispatcherName, ActivityType, COUNT(ActivityType) AS Total FROM Activity WHERE (BeginTime >= '4/5/2011 12:00:00 AM') AND (EndTime <= '7/13/2011 12:00:00 AM') GROUP BY DispatcherName, ActivityType ORDER BY Total DESC I'm getting the result as follows: N/A VOX 311 Olson State Change 37 Fred State Change 26 Dave PTT 25 George PTT 25 Olson PTT 23 Dave State Change 22 Jason PTT 22 George State Change

Can a silverlight client access a local sql compact database that is stored in isolated storage

家住魔仙堡 提交于 2019-12-13 16:44:20
问题 Does the silverlight clr support access to a sql compact database placed in the silverlight application's isolated storage? If so, any pointers to code samples. I would like to cache information retrieved from the server in previous sessions. 回答1: Even if it was stored in Isolated Storage, there is no Silverlight library to read in SQL Server Compact Edition. Perhaps in a future version. I have heard of a couple of open source projects that are trying to do this but there are not any that