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

Can an existing 3.0 .sdf using a vb5 app on windows mobile be upgraded to 3.5 without app change?

$
0
0

Hello,

I inherited a mobile device running windows mobile 6.1 with a custom vb5 (productver=8.0.50727 in vbproj) application. I created a new sdf in Sql server 2008, compact version 3.5. I upgraded the windows mobile device and the cgacutil reports .Net Compact Framework [3.5.7283.0, 2.0.7045.0]. But when I execute the application I receive an error “You are trying to access an older version of a Sql Server……. Db version=3505053, Requested version = 3004180, File name = SD Card\filename.sdf ]”. Is it possible to use an updated sdf with this application? I noticed Includes in the project file that reference system.data.sqlclient, version=3.0.3600.0, culture=neutral  and

system.data.sqlservice, version=3.0.3600.0, culture=neutral.

Aditionally, there are import statements;

 <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.VisualBasic.v1.targets" />

  <Import Condition="'$(TargetFrameworkVersion)' == 'v2.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.VisualBasic.targets" />

Can an updated file work with this application or are application changes needed, or am I looking in the wrong direction all together?

Thanks for the help,


SDF Corruption when stored on a Storage Card

$
0
0

 

Hello,

 

  I have an application on Windows Mobile devices, whereby it uses a SDF database sitting on an SD card. The problem is that a customer of ours seems to get regular corruption issues with the SDF

error 25115 Wrong Page (potential database corruption).

 

The error occurs normally when the Device attempts to do a Sync with Merge Replication.

 

From the research that I have done it seems that having an SDF on a storage card is not recommended. I would gladly move the SDF location off the storage card, except it is approx 180MB (it is a big application and synchronises with a big database for this Client)

 

Is there any other alternatives I have other than moving off the storage card?

Are there any Storage Cards which are less prone to corruption of SDFs?

 

Any help much appreciated, Thanks.

set FLUSH INTERVAL=1, flush changes to disk need more than 6 seconds when multi apps access SDF file. Why? How to flush ASAP?

$
0
0

Set FLUSH INTERVAL=1, flush changes to disk need more than 6 seconds when multi apps access SDF file. Why? How to flush as soon as possible?

Connection string = "Data Soruce=d:\db.sdf;password=123456;FLUSH INTERVAL=1"

What I want is to flush the changes to disk as soon as possible.


Felix

How to Convert a ResultSetView into a Quearable collection?

$
0
0

Hi,

How to Convert  ResultSetView into a Quearable collection?

Thanks


sankar


@@identity

$
0
0

I'm having the issue where @@identity returns null.

I've seen several responses that @@identity is a session variable.

I'm coding directly with ado.net(sqlserverce)

I execute my insert and then do a select for @@identity.

I don't see the connection state changing to closed between the calls.

In addition I get the exact same behavior if I run the query analyzer.

Most posts I see mention the query analyzer works for them with @@identity.

Is there som property of the engine I need to set or something?

I'm running sqlserverce 4 swith visual studio 2011.

SQL Server CE4.0 runs very slow in windows XP

$
0
0

Hi,

We currently run into an issue where access to our CE4.0 database is very slow under windows XP. Any query takes about 10 seconds to run. It runs nearly instantly on our Win 7 development machines. According to our profiler, the "OpenStore" method takes all the time.

We have .net 4.0 installed. The database file is writable and we know that the file is written to because the modified time changes.

Any clue on where to look for a solution?

Is there any parameters that can be put in app.config that would enable logging/tracing of a CE 4.0 application?

 

SQLce for Citrix Xenapp Environment and virtual drives

$
0
0

Hello, (I'm french, So excuse my bad english :/ )

I'm working on a C#.Net (Framework 2.0 - SQLce 3.5 SP2) application which uses 3 SDF databases, 2 just for read and 1 to store informations from my application. There's no problem running on local computer.

My problem is when I use this application on a Citrix Xenapp Environment (under Windows Server 2003 Standard Edition SP2). The app.config file set the path of the database to Y:\Data. This Y:\ is a virtual drive (subst y: d:\users\xxx, where xxx is the login of the user who run the Citrix session). So each user got his own directory. When the application is running for 2 differents users at the same time, exceptions occurs sometimes on start of the application and sometimes when datas are stored in db.sdf.

It seams that the program have a reference to the Y: and don't set the path to d:\users\xxx. Does anyone knows if the system locks the path (Y:\Data\db.sdf) ? I'd a look to ProcessMonitor and there's no refer to Y:, the 2 paths logged are 'D:\users\user_a\Data\db.sdf' and 'D:\users\user_b\Data\db.sdf'.

I've found a solution : I refer in app.config the path to d:\users\|user_name|\Data and I replace |user_name| by the user login before create the connection to the db.sdf. This works great but I don't understand why Y:\Data doesn't.

Any ideas ?

How to send data from my Mobile databsde ( *.sdf File) to oracle databse table

$
0
0

hello

I had my local database in smartdevice  i.e  SDF file . which i need to send data to oracle database table. I able to insert data into sqlserver. But how can i push data into oracle from muliple handle devices.


Subhash


Unable to load SQL Server Compact components?

$
0
0

I set my program up for private deployment using the instructions from this tutorial. I gave my program to the client and ran into another problem with the database. When they open the program the data doesn't show up in the DataGridView. So I went back in to my program in Visual Studio and tried to run it so I could figure out what was wrong. After I hit the run button this message came up:

I found the KB article mentioned in the error message. You can look at it here. I followed the link in the resolution section and made sure I had Service Pack 2 of SQL Server Compact. I did in fact have the last version. I don't know what else to do. I've followed the instructions per the KB article and yet the problem occurs. Any ideas what I should do next?


-- Tyler Hughes



How to implement sorting in DataGrid with SqlCeResultSet as Source?

$
0
0

Hi All,

How to implement sorting when the header of a column in DataGrid is clicked and the DataGrid is bound to a SqlCeResultSet.

Thanks in advance.


sankar

How to Convert a ResultSetView into a Quearable collection?

$
0
0

Hi,

How to Convert  ResultSetView into a Quearable collection?

Thanks


sankar


SqlCeResultset Delete after Seek

$
0
0

I need to delete the specific record in SqlCE 3.5 database.

I used SqlCeResultset:

SqlCeCommand cmdDs = conn.CreateCommand();//PARCELA_DS cmdDs.CommandText = "PARCELA_DS"; cmdDs.CommandType = CommandType.TableDirect; cmdDs.IndexName = "Cpan"; conn.Open(); SqlCeResultSet rsDs = cmdDs.ExecuteResultSet(ResultSetOptions.Updatable | ResultSetOptions.Scrollable);

//DataTable dt

Then I tried to delete specific record:

foreach(DataRow dr in dt)

{

dsCpan=dr[1];

bool found = rsDs.Seek(DbSeekOptions.FirstEqual, new object[] { dsCpan }); if (found)

{ rsDs.Delete(); }

// then follows adding record with new data.

}

but I got exception "No data exists for the row/column". I think that Seek() points on the record which I want to delete. I tried it with ResultsetOption.Sensitive but the result was the same.

Where is the mistake? Thanks for answer.




native components of version 8154 that are incompatible with ADO.NET provider of version 8080

$
0
0

Dear Experts,

Platform: i.mx53 WinEC7/512MB Custom board.

I am trying to test SqlCE in my device platform, but I got error ~

I had upgraded SSCEDeviceRuntime-CHS.msi.
When I try to use SqlCeDataReader or SqlCeDataAdapter, I will got following error:

Exception Code: 0x80000002
Exception Address: 0x42a34ef0
Faulting Module: sqlceme35.dll
at NativeMethods.GetValues(……
The application is trying to load native components of version 8154 that are incompatible with ADO.NET provider of version 8080……

I checcked my device platform's Sqlce version at [/HKEY_LOCAL_MACHINE/SPFTWARE/MICROSOFT/MICROSOFT SQL SERVER COMPACT EDITION/V3.5]:
Version: 3.5.8154
ServicePack: 2
BuildMajor:1FDA(8154)
BuildMinor:0

I thought this is a version compatible issue.
But I can't got service pack to upgrade my develope pc to sqlce 8154.
The latest version I saw is 3.5.8080
(http://support.microsoft.com/kb/950550)

Can anyone tell me how to resolve this error ?!

Thx~

HB

Compact 3.5 and error at SQL ?

$
0
0

Hello

Compact 3.5 support "INSERT scope Identity " and "Select OUTER APPLY "?

Thanks.

How to implement sorting in DataGrid with SqlCeResultSet as Source?

$
0
0

Hi All,

How to implement sorting when the header of a column in DataGrid is clicked and the DataGrid is bound to a SqlCeResultSet.

Thanks in advance.


sankar


Error at SQL query ?

$
0
0

Hello

What should SQL be instead of below SQL for compact 3.5 ?

---------------------------

---------------------------
There was an error parsing the query. [ Token line number = 1,Token line offset = 1,Token in error = ; ]   konum: System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()

   konum: System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)

   konum: System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior)

   konum: System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior)

   konum: System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

   konum: System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

   konum: System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)

   konum: System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

   konum: MsDataAccess.ExecuteQuery(SqlCeConnection connection, String query, Object[] pObjects) C:\_Work\_Projeler\winform\TicariSeteGiriş - SQLCompact\TicariSet\MsDataAccess.cs içinde: satır 265
At
;with src as( 

SELECT       

x_stokhareket_F_001.x_id, x_stokhareket_F_001.x_grup2, x_stokhareket_F_001.x_grup1, 

x_stokhareket_F_001.x_ozelkod2, x_stokhareket_F_001.x_ozelkod1, x_stokhareket_F_001.x_dovizkur, 

x_stokhareket_F_001.x_doviztur, 

x_stokhareket_F_001.x_fiyat,

x_stokhareket_F_001.x_cikistutaridoviz,

x_stokhareket_F_001.x_giristutaridoviz,

x_stokhareket_F_001.x_cikistutari,

x_stokhareket_F_001.x_giristutari,

x_stokhareket_F_001.x_cikistutaridoviz+ x_stokhareket_F_001.x_giristutaridoviz AS x_stokhareket_tutardoviz, 

x_stokhareket_F_001.x_cikistutari + x_stokhareket_F_001.x_giristutari AS x_stokhareket_tutar, 

x_stokhareket_F_001.x_cikismiktar, 

x_stokhareket_F_001.x_cikismiktartemel,

x_stokhareket_F_001.x_girismiktar,

x_stokhareket_F_001.x_girismiktartemel,

x_stokhareket_F_001.x_cikismiktar + x_stokhareket_F_001.x_girismiktar AS x_stokhareket_miktar, 

x_stokhareket_F_001.x_cikismiktartemel + x_stokhareket_F_001.x_girismiktartemel AS x_stokhareket_miktartemel,

x_stokhareket_F_001.x_birim, x_stokhareket_F_001.x_temelbirim,

x_stokhareket_F_001.x_aciklama, x_stokhareket_F_001.x_hareketsaati, 

x_stokhareket_F_001.x_harekettarihi, 

x_stokhareket_F_001.x_evrakno, 

x_stokhareket_F_001.x_hareketno, 

x_stokhareket_F_001.x_islemyeri, 

x_stokhareket_F_001.x_evrakadi, 

x_stokhareket_F_001.x_islemturu,

x_stokhareket_F_001.x_faturasatishareketid,

x_stokhareket_F_001.x_faturaalishareketid,

x_stokkarti_F_001.x_kod, x_stokkarti_F_001.x_adi, 

x_depotanimlari_F_001.x_kod AS x_depotanimlari_x_kod, 

x_depotanimlari_F_001.x_adi AS x_depotanimlari_x_adi, 

x_subetanimlari.x_kod AS Expr5, 

x_subetanimlari.x_adi AS Expr6,

x_carikarti_F_001.x_kod AS x_carikodu,

x_carikarti_F_001.x_adi AS x_cariadi,

x_carikarti_F_001.x_id AS x_cariid,

x_doviztanimlari_F_001.x_sembol AS x_dovizsembol



FROM            x_stokhareket_F_001 

OUTER APPLY (SELECT TOP 1 x_id, x_kod, x_adi FROM x_stokkarti_F_001 WHERE x_stokhareket_F_001.x_stokid = x_stokkarti_F_001.x_id) AS x_stokkarti_F_001 

OUTER APPLY (SELECT TOP 1 x_id FROM x_kullanicilar WHERE x_stokhareket_F_001.x_stokhareketolusturankullaniciid = x_kullanicilar.x_id) AS x_kullanicilar 

OUTER APPLY (SELECT TOP 1 x_id, x_kod, x_adi FROM x_depotanimlari_F_001 WHERE x_stokhareket_F_001.x_depoid = x_depotanimlari_F_001.x_id)  AS x_depotanimlari_F_001

OUTER APPLY (SELECT TOP 1 x_id, x_kod, x_adi, x_sembol FROM x_doviztanimlari_F_001 WHERE x_stokhareket_F_001.x_doviztur = x_doviztanimlari_F_001.x_id) AS x_doviztanimlari_F_001

OUTER APPLY (SELECT TOP 1 x_id, x_kod, x_adi FROM x_subetanimlari WHERE x_stokhareket_F_001.x_subeid = x_subetanimlari.x_id) AS x_subetanimlari

OUTER APPLY (SELECT TOP 1 x_id, x_kod, x_adi FROM x_carikarti_F_001 WHERE x_stokhareket_F_001.x_cariid = x_carikarti_F_001.x_id) AS x_carikarti_F_001



WHERE (NOT (x_stokhareket_F_001.x_id IS NULL)) AND (x_stokhareket_F_001.x_harekettarihi >= @x_stokhareket_x_harekettarihimin) AND (x_stokhareket_F_001.x_harekettarihi <= @x_stokhareket_x_harekettarihimax) ), cte as (

   select  t1.* 



   , (select sum(t2.x_girismiktartemel) - sum(t2.x_cikismiktartemel) 

       from src t2 where t2.x_harekettarihi < t1.x_harekettarihi  or ( t2.x_harekettarihi = t1.x_harekettarihi  and t2.x_id <= t1.x_id ) 

       ) as mevcuttemel

 , (select sum(t2.x_girismiktar) - sum(t2.x_cikismiktar) 

       from src t2 where (t2.x_harekettarihi < t1.x_harekettarihi and  

t2.x_birim = t1.x_birim)  or 

( t2.x_harekettarihi = t1.x_harekettarihi  and t2.x_id <= t1.x_id and  

t2.x_birim = t1.x_birim ) 

       ) as mevcut

, (select sum(t2.x_giristutaridoviz) - sum(t2.x_cikistutaridoviz) 

       from src t2 where (t2.x_harekettarihi < t1.x_harekettarihi and  

t2.x_birim = t1.x_birim and t2.x_doviztur=t1.x_doviztur)  or 

( t2.x_harekettarihi = t1.x_harekettarihi  and t2.x_id <= t1.x_id

and t2.x_doviztur=t1.x_doviztur ) 

       ) as bakiyedoviz

, (select sum(t2.x_giristutari) - sum(t2.x_cikistutari) 

       from src t2 where (t2.x_harekettarihi < t1.x_harekettarihi and  

t2.x_birim = t1.x_birim)  or 

( t2.x_harekettarihi = t1.x_harekettarihi  and t2.x_id <= t1.x_id) 

       ) as bakiye

    from src t1

 )



 select  cte1.*

FROM (select *,





  mevcuttemel AS x_mevcuttemelL

 

, mevcut AS x_mevcutL

 

from cte) cte1   Order By cte1.x_harekettarihi, cte1.x_id
---------------------------
Tamam   
---------------------------

How can I connect to a SQL Server Compact 3.5 file as a data source in Visual Studio 2012?

$
0
0

Visual Studio 2012 comes with SQL Server Compact 4.0. I have installed SQL Server Compact 3.5 from http://www.microsoft.com/en-GB/download/confirmation.aspx?id=5783 However I still only have the option of making a new data connection to a SQL Server Compact 4.0 file, whereas the files I need to get data from are SQL Server Compact 3.5 files.

enter image description here

Is it possible to connect to a SQL Server Compact 3.5 file as a data source in Visual Studio 2012? If so which settings or installs should I need?

(N.B. I'm not sure if this is a SQL Server Compact 3.5 question or a Visual Studio setup question so I'll post it to both groups; sorry if such cross-posting is incorrect.)

========== EDIT ==========

I've just found a stackoverflow answer (from ErikEJ) that suggests "SQL Server Compact 3.5 is not supported with Server Explorer etc in VS 2012". I hope that's not the case - has anyone had any luck?

SQL Query for my result ?

$
0
0

Hello

I need SQL for compact 3.5 about below result.

I have table and colums as in and out. i need result and result kind like below.

in      out          result      resultkind

10      0             10             In

5        0              15             In   (10+5-0=15) 15=15 In

0        20             5             Out     (15+0-20=-5) -5= 5 Out

How to implement paging in SQL Server Compact 3.5

$
0
0

I have been writing an application in WPF, VS2010 using SQL Server compact 3.5 where a windows loads thousands rows. So it takes a lot of time to do that. So I searched the internet looking for a way to page the result. But all solutions I found happen to be using TOP and OVER clauses which are not available in SQL Server Compact 3.5. So can any one help me giving me a solution? I would like to page the result rows of the following statement in my dataset:

SELECT Column1, Column2, Column3 From Table1 ORDER BY Column2


-k@N@k-

How to implement sqlce transaction using SqlCeHelper

$
0
0

I am using SqlCe 3.5 and the SqlCeHelper (C#) and I see the commands (ex: ExecuteNonQuery) have overloads that implement transactions.

What is the preferred way of implementing transactions using the SqlCeHelper?

Viewing all 193 articles
Browse latest View live


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