Quantcast
Channel: SQL Server Compact Forum
Viewing all 193 articles
Browse latest View live

Access to the database file is not allowed. [ File name = MyDB.sdf ]

$
0
0

I am developing a small windows form with sqlCE. i made an installer to deploy it to another machine. I added the MyDB,sdf to the Application Folder. but when i run the application it gives me following error.

Access to the database file is not allowed. [ File name = MyDB.sdf ]

i checked the folder in program file(86) and it contain the .sdf file but can't figure it out what is the problem.

my connection string is string ConString = @"Data Source=MyDB.sdf";

any idea what i am doing wrong?


Query to group items and count them??

$
0
0

Hi. This is what i need to do:

I have a notifications table, which contains a memberid and a notificationtypeid (email, standard mail, sms, etc), as well as its own notificationid and other notification-specific fields. I need to count how many notifications of each type were sent to each member, i.e. getting a result similar to this table here:


and so on.

what's the sql query to accomplish this? thank you.


Cannot use app with sql server ce 4.0 private deployment as external program for debug

$
0
0
I have the application with SQL Server CE 4.0 private deployment. It's work correctly in standalone mode. But when I try to use this installed application as "external program" in vs2010 for debugging an addon dll for this application I get exception:
is not a valid Win32 application.(Exception from 0x800700C1)
System.BadImageFormatException
See http://screencast.com/t/geDHSmcA
As I undestood the sqlserverce cannot find native libraries. When I copied the libraries from the x86 subfolder to app folder then the application is successfully launched from under the vs.
Is there a better way to debug what this hack?

any one tell me the code to connect to .sdf file in c# windows application?

$
0
0
Hi,

Any one tell me the code to connect to .sdf file in c# windows application?And tell the requirments to conncet.My sdf file path is this

C:\\Documents and Settings\\koti\\My Documents\\Example.sdf

I write this code.It is not working

 string str = "Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=C:\\Documents and Settings\\koti\\My Documents\\Example.sdf;SSCE:Encrypt Database=True";
                SqlCeConnection cn = new SqlCeConnection(str);
                cn.Open();

Ant one help me Plz...

Regards,
venkat.

SQL Server Compact for WinRT

$
0
0

Hi all

    some days ago I discovered that at the moment there is no support for SQL CE on WinRT!

Do you know if there will be a version of ce for WinRT?

king regards


Gian Paolo Santopaolo - softwarelab.it - thedarksideof.net
Disclaimer: This post is provided "AS IS" with no warranties, and confer no rights.

SQL CE 4 TO 3.5

$
0
0

Hello, sorry for my bad english:

I have an app that runs in 32-bit OS that create a SQL CE 3.5 database to load the DB in a PDA. But my client have to run the app on a 64-bit OS so i updated the sql ce to 4. But i found that SQL Server Compact 4.0 does not have a release for Windows Mobile. So i wanted to know if sql ce 4 can create a sql ce 3.5 DB or if i can copy my data from the db 4 to 3.5?

Thank you.


Unknown Error. Possibly SQL Server Compact is not correctly installed.

$
0
0

This is a similar issue to the one discussed in the thread here.  Basically I am unable to connect to a SQL Server Compact database from Visual Studio 2010 Ultimate.  I have tried all of the steps discussed in the previous thread and posted there with no response.

I have tried uninstalling Visual Studio 2010 Ultimate using the Visual Studio uninstallation utility (VS2010_Uninstall-RTM.ENU.exe /full /netfx) and reinstalling, but this does not fix the issue.  I would like to avoid having to install a new version of Windows 7 on my machine if at all possible.

The issue seems to have started around the time I began using the Microsoft Sync Framework 2.1.

Any suggestions would be greatly appreciated!

-Stuart


Stuart Summers

Odd issue with ClickOnce deployment on some machines

$
0
0

I have an odd issue with ClickOnce and SQLCE regarding the inability to load the sqlceme35.dll.

The issue I am having does not seem to be related to other issues related to the loading of 'sqlceme35.dll' that I have researched.

Details

  • SQLCE version 3.5.1.0
  • Using the correct private deployment strategy (x86 directory, targeting x86 build, DbProviderFactory override in app.config, etc)
  • Only ClickOnce affected; same binaries on the same machine function correctly when deployed via MSI or xcopy
  • Reproducible on a clean 32-bit Windows 7 VM
  • Not reproducible on all machines though
  • Previous version of the ClickOnce deployment still works
  • The previous version put the SQLCE native assemblies into the manifest via the Visual Studio project; creating an x86 directory and adding into that directory the native assemblies as links ("Add as Link"), thus VS/msbuild handled it.
  • The current version uses a post build process to add the files to the manifest.
  • The entries for the native assemblies in both manifests (previous version and current version) are identical.
  • I am able to verify that the file "x86\sqlceme35.dll" exists in the SQLCE deployment
  • If I navigate to the ClickOnce executable (appdata/local/apps/...) and launch the executable directly, everything works as expected.
  • If I place the SQLCE native assemblies in the the same directory as the executable and re-ClickOnce deploy, they are found correctly and I have no issue (except that I have now lost the x86/amd64 detection for ClickOnce deployments)

Does this issue sound familiar to anyone?  What else can I do to try and pinpoint the reason why the assemblies cannot be found in the x86 directory but are found in the main executable directory?

Thanks.


Possible to map DataType being read from SqlCe?

$
0
0

I have a 3rd party dll that reads from Sql2008 and internally maps VarChar fields to AnsiString.

I want to use the dll with SqlCe which uses NVarChar instead of VarChar ... when a method on the dll is called on a connection to the sdf I get the error:

     "No mapping exists from DbType AnsiString to a known SqlDbType"

... understandably it won't automatically be able to convert unicode to the more restrictive ASCII.

Is it possible to map SqlCe DataType.NVarChar to AnsiString?

I did see this, but don't use NHibernate: http://netfrustrations.blogspot.com/2009/10/nhibernate-mapping-typeansistring.html

Thanks.

(FYI: I have been using the dll successfully ... they just changed to AnsiString recently)

Why is SysTrackingContent suddenly empty in SqlServerCE (using SyncFramework) ?

$
0
0

Hi,

I am using SqlServer CE 3.5.1 with the SyncFramework 1.0 and EntityFramework 4.0.

Everything works fine until I update my database. After calling Context.SaveChanges() within my app the column of my Tracking "_SysTrackingContent" is empty. Before saving it was filled with values.

After a little research I found the static Method UpgradePublicTracking which seems to be the solution, but it isn't in my case.

Here the link http://technet.microsoft.com/en-us/library/system.data.sqlserverce.sqlcechangetracking.upgradepublictracking%28v=vs.97%29.aspx

Have you any hints to solve the problem?

best regards,

Thomas

What strategy is used to pick the next connection if multiple candidates wait for a lock? Could one starve to death?

$
0
0

I am seeing SQL Server reporting deadlock errors and after some investigation, I found that they are not really deadlocks, but rather connections running into timeouts while waiting for a lock.

I have an application that uses multiple threads and connections (each thread has its own connection) to insert new data. All threads basically populate the same tables (say ORDER and ORDERITEMs), so the sequence of events is:

  1. Thread #1: INSERT INTO ORDER (order locked)
  2. Thread #2: INSERT INTO ORDER (blocked)
  3. Thread #3: INSERT INTO ORDER (blocked)
  4. ...(e.g. thread#1 insert into orderitem) ...
  5. Thread #1: COMMIT (releases lock)
  6. Thread #3: continues work
  7. ...
  8. Thread #3: COMMIT
  9. Thread #2: continues work

Apparently, SQL Server has picked Thread #3 to continue, rather than Thread #2, although it was waiting longer. 

What I am seeing in my logs is that every now and then under high load a thread would starve to death waiting to be picked. Other threads that came in later get served, continue their work and finish after 200-400 msecs. 

Is my understanding correct? Is there a way to influence this (other than increasing the timeout, which does not actually solve the issue)?

J.-


DbGeography Data Type Support

$
0
0
Are there plans for SqlCe to support DbGeography? If yes when is it expected to happen?

Please can anyone tell that coding of Add the tootip for indivisual cell in gridview can anyone tell ?

$
0
0
Please can anyone tell that coding of Add the tootip for indivisual cell in gridview can anyone tell ?

SQLCE 3.5 VS2008 - VB.NET Refuses to INSERT

$
0
0

Hi all,

I have a small vb.net app and am using SQLCE to store the data. I have written a small sub to store a record in the DB but it seems to refuse to work. Here is the code:

Dim ConnCeSQL = New SqlCeConnection(My.Settings.CollectorConnectionString)
ConnCeSQL.Open()

Dim CmdCeSQL = New SqlCeCommand("INSERT INTO tbl_Application_Data_Collections([Name], [Building], [Room], [Room Code],[Created]) VALUES('Test','Test','Test','Test','01/02/2012')", ConnCeSQL)
       
CmdCeSQL.ExecuteNonQuery()
ConnCeSQL.Close()

Effectively the code seems to function but when I check the table, no record has been added. I don't receive any error messages.

I know that the code can access the table, as if I force an issue with a field name, an error comes back telling me that the column doesn't exist.

I have added a few message boxes into the code too to capture the connection state and also the number of rows affected. I can see the connection is open and that it returns 1 affected row, but no data.......

If I copy the INSERT command into the SQLCE editor within VS2008 and execute it, a new row is inserted.

I am at a loss now, to be honest.

I hope that someone can tell me what i'm doing wrong.

Many Thanks

Simon

how to sort version Number?

$
0
0

Hi All,

Can any one give me a sql statement for sorting version numbers.

when i used the below query

SELECT [Policy ID] FROM [ITPP] ORDER BY cast('/' + replace([Policy ID] , '.', '/') + '/' as varchar(max)) 

eg 

ITPP 1.0
ITPP 10.0
ITPP 11.0
ITPP 12.0
ITPP 13.0
ITPP 13.1
ITPP 13.2
ITPP 14.0
ITPP 15.0
ITPP 16.0
ITPP 17.0
ITPP 18.0
ITPP 19.0
ITPP 2.0
ITPP 20.0
ITPP 21.0
ITPP 22.0
ITPP 3.0
ITPP 4.0
ITPP 5.0
ITPP 6.0
ITPP 7.0
ITPP 8.0
ITPP 9.0

after ITPP 1.0 next value should be ITPP 2.0 instead ITPP 10.0 comes 


SQL Query runs on SQL Server, but not on SQL Server Compact

$
0
0

Hello together,

this query works fine on MS SQL Server, but not on SQL CE:

select a.Gender
, a.Last_name
, a.first_name
, b. level
from patients  a left outer join (select x.id
, x.PatID
, x. level
from level x
where x.id = (select max(x1.id)
                       from level  x1
                       where x1.PatID  = x.PatID )) b
on (a.PatientID  = b.PatID )

Please help me, how to resolve it to work on SQL Server Compact!

Thanks

Mario

Msi files Installation On Windows CE

$
0
0

Hi Every body,i need to install sqlserver on windows ce.

i download the msi file and i had installed latest version of active sync.

but it ddidnt execute,what should I DO?

I should say, icant install any other application too.

sqlcmdObject.ExecuteNonQuery() throws sqlcexception???

$
0
0

Hi,

I'm trying to update a record in a table using the below update command.

sqlcmdObj= sqlConnObj.CreateCommand();
sqlcmdObj.CommandText = "UPDATE WS_LOCATION SET Frequency = @FreqParams, LUTime = @LUTimeParams" + sWorkSpaceName + sFolderName + ", Client = '" +
                                                htInputParams["Client"].ToString().Replace("'", "''") + "', Matter = '" +
                                                htInputParams["Matter"].ToString().Replace("'", "''") + "' WHERE WSLoc_ID = '" + strLocationId + "'";

                   
                    transaction = sqlConnObj.BeginTransaction(IsolationLevel.Serializable);
                    sqlcmdObj.Connection = sqlConnObj
                    sqlcmdObj.Transaction = transaction;

                    SqlCeParameter FreqParams = sqlcmdObj.Parameters.Add("@FreqParams", SqlDbType.Int);
                    FreqParams.Value = frequency;

                    SqlCeParameter LUTimeParams = sqlcmdObj.Parameters.Add("@LUTimeParams", SqlDbType.DateTime);
                    LUTimeParams.Value = DateTime.Now;

sqlcmdObj.ExecuteNonQuery().

********************************

But ExecuteNonQuery() throws the below error message.

There was an error parsing the query. [ Token line number = 1,Token line offset = 76,Token in error = 14286 ]    at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at iwovEFS.DbAccess.UpdateFrequencyTable(Hashtable htInputParams)
   at iwovEFS.DbAccess.InsertIntoLocationsTable(Hashtable htInputParams, Int32& errorcode) UPDATE WS_LOCATION SET Frequency = @FreqParams, LUTime = @LUTimeParams, WSName = '汉语/漢語', FolderName = '中文', Client = '', Matter = '' WHERE WSLoc_ID = '9' occured on InsertIntoLocationTables.

Here wsname and foldername are chineese characters. What should be the problem? How do I resolve this issue?

Thanks

SQLCE 3.5 dependencies

$
0
0

I have a windows application that users SQL CE 3.5 as local store. When i install it in client machines., the SQL CE (.SDF) file is not created.

I'm sure that i have copied the dependent dll's viz., sqlceca35, sqlcecompact, sqlceer35en, sqlceoledb35, sqlceqp35, sqlcese35, system.data.sqlserverce

Any help is appreciated.




-- Viswanth V.G

Strange foreign key behaviour

$
0
0
I'm using SQL server 2000 and seeing a strange behavior

I have 2 tables namely
site
machine

machine table has foreign key and it referenced to site.column1

But if i select machine table it shows values that are not in site.column1

How come it possible?

Please let me know.

Thanks,
Venkat.

Best Regards, Venkat


Viewing all 193 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>