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

Getting data from two tables in Sqlserver CE

$
0
0

I have Two Tables Parent and Child, like employee and department table. I want to display department name(ntext type) sorted by the number of times they occur in Employee table,The one with the most occurrences should be listed first. please tell me the solution urgent and the SQL statement should Supported by SqlCE

Thanks in advance....


PraveenKumar Ch .Net Developer



SqlCe Version problems?

$
0
0

Well not yet anyway but I think in delaying a problem:

Im focusing on versioning problem. I have two 64 bit development systems. On both systems I have VS2012 which installs sqlCe V4.o. Neither of the system run this software. I also have a beloved old V3.5 Database system that I call regularly. Is there are a problem with sqlCe version mismatches? Come to think of it the I've seen no problem.

V3.5 system runs all the time with VS2012 running while sqlce is down. Would it make a difference if I brought the sqlCe server up and developed while not running the v3.5 system? What would happen were the sqlCe system was brought up while the other sqlCe system were running?

Renee


"MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me

Help with database .sdf please

$
0
0
I am trying to figure out how I take data from a text box and save it in a database. But I'm really out of my zone here. I know how to save to a file just really lost when comes to database

lord of magika, knight of love, destroyer of hate


SQL Server CE 3.5 SP2 instability on CE 6 Psion device

$
0
0

Hello,

I'have just upgraded an .Net CF 1 application :
- from Windows CE 4.2 SQL Server
- to Windows CE 6 / SQL Server CE 3.5 SP2 / .Net CF 3.5

The target device is Psion Omni XT15.The "old" application was executed on Psion Workabout 3.

The migration process was fonctionnaly sucessful, but there is a technical problem that boring me.

Some time, the application crash because the database is corrupted. Recreating a new database is not anought to restore the application : I need to reinstall SQL Server.

I don't think that the problem comes from the application itself, but I'm not sure : how an application could corrupt SQL Server installation ?

Are there some know problems with SQL Server  3.5 SP2 under Windows CE 6 on ARM4 platform ?


Thanks for your help.

Merci de tagger "Proposer comme réponse" et/ou "Utile" si un post répond à votre demande.


SQL Server CE 3.5 SP2 cab for Windows CE 6 Arm ?

$
0
0

Hello,

I developped an .Net CF 3.5 application for Windows CE 6 on Psion ARM4 device. I use SQL Server 3.5 SP2.

For deploiement, I used the .cab files sqlce.wce5.armv4i.CAB, sqlce.repl.wce5.armv4i.CAB, sqlce.dev.FR.wce5.armv4i.CAB.

Is there a specifique build of SQL Server 3.5 CE for Windows CE 6 ?

Best regards.


Merci de tagger "Proposer comme réponse" et/ou "Utile" si un post répond à votre demande.

Sync Access Database table to SQLCE table

$
0
0

OK, I have a WindowsForms application that uses a SQLCE for user data storage. I also have an Access Database (On network) that I would like to use as a data source. I am looking to sync a table from that access database to a table in the SQLCE database.

Is this possible without looping through all of the data?

It would be cool if I could query the Access database into a dataset object, and merge the two with one statement...

Thanks,

neech


neech

Error in my program

$
0
0

Dear all,

i'm using c# and sqlCeServeur. I've got a terrible error in my programm : The column name is invalid [node name (if any), column name = ProteinesBrutes]. As you can see, there aren't any space in my column name. Should i just put my computer in the trash ? x)

Thanks for all,

Rémi V.

How to delete a row from a SQL Server CE Table with multiple JOINs?

$
0
0

I want to delete a record from a SQL Server CE table.

There are 3 tables scripts, options and results. I would like to remove a record from the results table. The where clause contains dynamic information which retrieved via other queries to different tables in the same database. These queries work fine and deliver the desired data.

The Compact server is a clone of a remote table created using the sync framework. The same query to the remote table works fine.

The error I get is:

There was an error parsing the query. [ Token line number = 1,Token line offset = 10,Token in error = from ]

The code that throws the exception is as follows:

Dim connLoc As SqlCeConnection = New SqlCeConnection(My.Settings.ConnectionString)

connLoc.Open()     

Dim strDel As String = "Delete r from ResultsTable r inner join OptionsTable o ON o.TestName=r.TestName inner join ScriptTable c ON r.TestName=c.TestName WHERE r.TestName = '" & ds1Loc.Tables(0).Rows(0)(1) & "' AND [Index] = '" & lstIndex & "'"

Dim cmdDel As SqlCeCommand = New SqlCeCommandcmd

Del.CommandText = strDelcmdDel.Connection = connLoccmdDel.ExecuteNonQuery()

The values held in ds1Loc.Tables(0).Rows(0)(1) and lstIndex are correct so should not be the problem.

I also tried using parameterised queries

Dim strDel As String = "Delete r from [ResultsTable] r inner join [OptionsTable] o ON o.TestName=r.TestName inner join [ScriptTable] c ON r.TestName=c.TestName WHERE r.TestName = @TestName AND [Index] = @lstIndex" Dim cmdDel As SqlCeCommand = New SqlCeCommand       

cmdDel.CommandText = strDel       

With cmdDel.Parameters            .Add(New SqlCeParameter("@TestName", ds1Loc.Tables(0).Rows(0)(1)))            .Add(New SqlCeParameter("@lstIndex", lstIndex))        End With 

cmdDel.Connection = connLoc       

cmdDel.ExecuteNonQuery()

I have tried replacing the "=" with "IN" in the the WHERE clause but this has not worked.

Is it the join that is causing the problem? I can do a select with the same search criteria and joins from the same database.

Also this query works with SQL Server. Is it perhaps that SQL CE does not support the Delete function the same as SQL Server 2008? I have been looking at this for a while now and cannot find the source of the error. Any help would be greatly appreciated.






SqlCe BindingSource.AddingNew object - AddingNewEventArgs.NewObject confusion

$
0
0

OK, I want to use the BindingSource.AddingNew event to create a new database row and automatically fill in some of the feilds before the user enters in the data. For example, I would like to fill in an automatically generated id...things like that. The feilds that I enter in manually the user will not have access to on the form.

However, I don't know how to create a new row and assign it to the e.NewObject of the AddingNewEventArgs event handler.

Any help is greatly appreciated. I want my routing to look something like this, but it's not working and I can't think of an alternative.

Public Sub VenderBindingSource_AddingNew(ByVal sender as Object, ByVal e as AddingNewEventArgs) Handles VenderBindingSource.AddingNew
         ' get error, can't just create a new row
         Dim theNewRow as New DataRow()
         theNewRow.Row.Item(0) = 39233
         e.NewObject = theNewRow
End Sub

Thanks,

neech


neech

Couldn't find existing RSCB 1 after synchronize SQL Server Compact 3.5 SP2

$
0
0

Hi

When i try to replicate database on my device with server database I get following message on the screen "The IIS service is not available."

In the SQLCESALOG is:

012/12/15 17:28:57 == SQLCESA Version ==> 3.5.8080.0
2012/12/15 17:28:57 Hr=00000000 SQLCE Server Agent Loaded - Version 3.5.8080.0
 0
2012/12/15 17:28:57 Hr=00000DE4 Sync Thread started 1
2012/12/15 17:28:57 Hr=00001394 Transfer Thread started 1
2012/12/15 17:28:57 Hr=00001034 Transfer Thread started 1
2012/12/15 17:28:57 Hr=00000C08 Cleanup Thread started 1
2012/12/15 17:28:57 Hr=80004005 ERR:Couldn't find existing RSCB 1
2012/12/15 17:28:57 Hr=00000000 Compression Level set to  1
2012/12/15 17:28:57 Hr=00000000 Count of active RSCBs =  0
2012/12/15 17:28:57 Thread=1394 RSCB=1 Command=OPWC Hr=00000000 Total Compressed bytes in =  160
2012/12/15 17:28:57 Thread=1394 RSCB=1 Command=OPWC Hr=00000000 Total Uncompressed bytes in =  269
2012/12/15 17:28:57 Thread=1394 RSCB=1 Command=OPWC Hr=00000000 Responding to OpenWrite, total bytes =  160
2012/12/15 17:28:57 Thread=1394 RSCB=1 Command=OPWC Hr=00000000 C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\sync\SQL\SQLPublication\30.64BA9B22BCFF_9CE6C43F-BCDB-FA7B-8148-4D5B2AD2669D 0
2012/12/15 17:28:57 Thread=DE4 RSCB=1 Command=SYNC Hr=00000000 Synchronize prepped 0
2012/12/15 17:28:57 Thread=DE4 RSCB=1 Command=SYNC Hr=00000000 10.0 server found. Trying 10.0 error components... 0
2012/12/15 17:28:57 Thread=DE4 RSCB=1 Command=SYNC Hr=00000000 Could instantiate 10.0 error components 0
2012/12/15 17:28:57 Thread=DE4 RSCB=1 Command=SYNC Hr=00000000 10.0 server found. Trying 10.0 reconciler components... 0
2012/12/15 17:28:57 Thread=DE4 RSCB=1 Command=SYNC Hr=00000000 Could instantiate 10.0 replication components 0

In the replication monitor i get some lines with the erorr:

<dir>

The replication agent has not logged a progress message in 10 minutes. This might indicate an unresponsive agent or high system activity. Verify that records are being replicated to the destination and that connections to the Subscriber, Publisher, and Distributor are still active.

</dir>

And in the event viewer of the IIS server i get

A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '4996'. The data field contains the error number.

It looks like that server could not comunicate with my device.

Could someone help me to solve this mistery? Thanx

Rename table and column

$
0
0
I refer to the online book .
But still can't find the way to rename column name .

My CE version is 3.5sp1 .

Could someone give me some advice ?
Thanks a lot .

To be code or not . It is a problem.

how to select the odd records

$
0
0

I have this tableA

PK, debit, Credit, account

1, 1, null, Account1
2, null, 1, Account1
3, 1, null, Account1
4, 1, null, Account2


I want you to help me a sql command to select the 3rd and 4th records. Means that I want all records except the records with debit=credit & Account=Account

My sql command :

SELECT [TableA].*
FROM [TableA] LEFT JOIN
(SELECT [TableA_3].*
FROM [TableA] AS [TableA_3] INNER JOIN
[TableA] AS [TableA_1] 
ON [TableA_3].debit = [TableA_1].credit 
AND [TableA_3].account = [TableA_1].account)
AS [TableA_2] 
ON [TableA].pk = [TableA_2].pk
where [TableA_2].pk is NULL

only select the 4th record because the TableA_2 is contained first 3 records.

Thanks for your help.


Converting SQL Server 2008 database to SQL Server compact edition file

$
0
0

HI

How to create an sql server compact database(sdf file) from sql server 2008 database.I want to do this one programatically using CSharp or SQL. Could you please help me on this?

SQL Server CE error Cannot open '|DataDirectory|\Test.sdf'. Provider 'System.Data.SqlServerCe.3.5' not installed.

$
0
0

I am trying to use SQL Server CE in my MVC 4 web app. I have a class library and I have added the reference to System.Data.SqlServerCe.dll (V4)

The code to create the SDF is:

String connString = "Data Source=|DataDirectory|\HomeController.sdf";
SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();

Which create a SDF with no problems

Next I try to work with the SDF like this:

XmlDocument xmlDoc = new XmlDocument();
XmlTextReader xmlReader = new XmlTextReader(ConfigurationManager.AppSettings["ApplicationSettingsPath"] + @"\CreateHomeControllerDatabase.xml");
try
{
    xmlReader.Read();
    xmlDoc.Load(xmlReader);

    foreach (XmlNode jobNode in xmlDoc.SelectSingleNode("Jobs"))
    {
        //TODO look at the old version on my old machine and debug this to see what the issue is
        DataContext db = new DataContext(DATABASE);
        db.ExecuteCommand(jobNode.InnerXml.Replace("<![CDATA[", String.Empty).Replace("]]>", String.Empty).Trim());
    }
}
catch (Exception ex)
{
    //ErrorHandler.ErrorDelegate.LogError(ex); TODO
}

As soon as it it hits DataContext db = new DataContext(DATABASE);I get the exception Cannot open '|DataDirectory|\Test.sdf'. Provider 'System.Data.SqlServerCe.3.5' not installed.

First things that looks strange is why is it asking for 3.5 when I added the 4.0 instance of the dll? I have not installed the SQL CE 4.0 on my machine as the intention of using CE was to easily install this on a client by just adding the dlls. I have added the other dlls in that folder where possible but it just errors.

Any ideas please?


sql ce 3.5 not comment data after insert it by code in c#

$
0
0
 
SqlCeCommand   Cmd = sqlscript.connect.CreateCommand();
            try
            {
                if (sqlscript.connect.State == ConnectionState.Closed)
                {
                    sqlscript.connect.Open();
                }

                Cmd.CommandType = CommandType.Text;//
                Cmd.CommandText =
@"insert into task_tb (id,type_task,date_year,date_month,date_day)
             values('"+id.Text +"','"+type.Text.Trim()+"','"+year.SelectedItem+"','"+int.Parse(month.SelectedValue.ToString())+"','"+day.SelectedItem+"')";
  Cmd.ExecuteNonQuery();
 data no store in database please help me

An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in WindowsApplication1.exe

$
0
0

I have made a simple project and connected it to a database through datasource. But when I am adding a record or trying to update any record through table adapters it gives me "An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in WindowsApplication1.exe" error.

I used the simple normal code for updating:

Private Sub EmpBindingNavigatorSaveItem1_Click(sender As Object, e As EventArgs) Handles EmpBindingNavigatorSaveItem1.Click
        Me.Validate()
        Me.EmpBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me._MyDatabase_2DataSet)
    End Sub

Could you please help me out with this....

Saniya

Windows 8 Photo gallery can't start because Microsoft SQL server 2005 compact edition is missing?

$
0
0

I've installed & uninstalled MS SqlSever 2005 in my system (OS - Windows 8). When am try to access my photo gallery on desktop, I'm getting above mentioned error. How come photo gallery is dependent on MS SqlServer 2005 compact edition?  Now, I've installed & using MS SqlServer 2008.

SQL Server Compact vs. Jet/ACE

$
0
0

I am trying to get a better understanding of what the benefits would be for using a SQL Server Compact database as opposed to a Jet/ACE database for the following situation:

- New WPF application - will be implemented in Visual Studio 2010 or 2012

- Single user - only one user of the application at a time

- Fairly complex datamodel in terms of number of tables and their relationships (100+ tables)

- Reasonable data volumes, a few tables with 100,000+ rows but most with rows in the thousands or less

Given this type of application, what are the benefits with SQL Server Compact Edition in the following areas (and any other that you would say are relevant):

- Performance

- Stability / Integrity

- Long term support (from Microsoft)

Unable to execute SQLCE script in VS 2012 Express for Windows Desktop

$
0
0

I am new to Entity Framework and SQL Server Compact.  I'm trying to use the "model first" method to create an Entity Framework 5.0 model and an SQLCE database.  After creating the model, I right-click the design surface and chose "Generate database from model" from the context menu. I was prompted for a database connection and selected SQL Server Compact and created a new database (the .sdf file was created with no tables and appears in Database Explorer). When I click Finish in the Generate Database wizard, a DDL script is created (Model1.edmx.sqlce) and opened in VS.  

The tutorial I am following says the next step is to right-click on the script and choose Execute SQL from the context menu.  The problem is that there is no Execute SQL choice in the menu. If I right-click on the open window for Model1.edmx.sqlce , my choices are:

  • Breakpoint
  • Run to Cursor
  • Run Flagged Threads to Cursor (grayed out)
  • Cut
  • Copy
  • Paste
  • Outlining

I also see that the icon for Model1.edmx.sqlce in Solution Explorer is the one for an unknown file type. If I right-click on the item in Solution Explorer there is still no Execute SQL option.

It appears that I am missing an association between the sqlce filetype and some component that is supposed to run the script to create the SQLCE database. Does anyone know what I need to do to get this to work?

.sdf corruption?

$
0
0

We are using SQL CE as a subscriber in a merge replication topology.  Occasionally, users get the following error when trying to sync with the publisher:


Cannot connect to C:\[pathRemovedByPoster]\DB.sdf.
Invalid provider type. [ Db version = 0,Requested version = 1,File name = \\?\C:\[pathRemovedByPoster]\DB.sdf ] (SQL Server Compact ADO.NET Data Provider)

I get the same error when I try to connect to the .sdf directly through SSMS.  I am under the impression that this is caused by .sdf corruption.  Is this true?  How can I tell?  I've seen the C# code that allows you to verify corruption, but does anyone know of a utility I can use so I won't have to get developers involved?  Is there any other info I can provide her that will help diagnose the problem?

Thanks in advance,

Clint


Clint

Viewing all 193 articles
Browse latest View live


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