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

Windows Phone 8 Stack Trace

$
0
0

Hi I got the following stack trace from one of my windows phone 8 applications which was called from the background agent called ScheduledTaskAgent1 while call a routine UpdateUI() from what I can gather:

Frame    Image                                   Function                                                                                                                   Offset        
0        Microsoft.Phone.Data.Internal.ni.dll    System.Data.SqlServerCe.SqlCeConnection.Open                                                                               0x00000534    
1        Microsoft.Phone.Data.Internal.ni.dll    System.Data.SqlServerCe.SqlCeConnection.Open                                                                               0x00000006    
2        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection                                                              0x0000008c    
3        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlProvider.Execute                                                                             0x00000038    
4        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll                                                                          0x00000080    
5        System.Data.Linq.ni.dll                 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute                                         0x0000026c    
6        System.Data.Linq.ni.dll                 System.Data.Linq.DataQuery_1[[System.__Canon,_mscorlib]].System.Linq.IQueryProvider.Execute[[System.__Canon,_mscorlib]]    0x00000040    
7        System.Core.ni.dll                      System.Linq.Queryable.FirstOrDefault[[System.__Canon,_mscorlib]]                                                           0x00000106    
8        ScheduledTaskAgent1.ni.DLL              ScheduledTaskAgent1.ScheduledAgent.UpdateUI                                                                                0x0000020a    
9        ScheduledTaskAgent1.ni.DLL              ScheduledTaskAgent1.ScheduledAgent.OnInvoke                                                                                0x00000078    
10       Microsoft.Phone.ni.dll                  Microsoft.Phone.Scheduler.ScheduledTaskAgent.Invoke                                                                        0x00000432    
11       Microsoft.Phone.ni.dll                  Microsoft.Phone.BackgroundAgentDispatcher+AgentRequest.Invoke                                                              0x00000344    
12       Microsoft.Phone.ni.dll                  Microsoft.Phone.BackgroundAgentDispatcher.InvocationThread                                                                 0x00000080    
13       mscorlib.ni.dll                         System.Threading.ThreadHelper.ThreadStart_Context                                                                          0x0000008a    
14       mscorlib.ni.dll                         System.Threading.ExecutionContext.RunInternal                                                                              0x00000088    
15       mscorlib.ni.dll                         System.Threading.ExecutionContext.Run                                                                                      0x00000010    
16       mscorlib.ni.dll                         System.Threading.ExecutionContext.Run                                                                                      0x00000042    
17       mscorlib.ni.dll                         System.Threading.ThreadHelper.ThreadStart                                                                                  0x00000042

I am trying to understand what this means and the routine for UpdateUI() is as follows:

private void UpdateUI()
        {
            // all variables I have commented out

            // Get the database context
            using (db context = new db(ConnectionString))
            {
                try 
                {
                    strTest = (from c in context.Setting
                                   where c.Code == "TEST"
                                   select c.Value).FirstOrDefault();
                }
                   catch (Exception)
                   {
                          // Do nothing for now
                   }
            }
                // Get database context
                using (db context = new db(ConnectionString))
                {
                    try
                    {
                        My_template dbMy_template  = new My_template();
                        dbMy_template.myDate = System.DateTime.Now.ToString();
                        dbMy_template.myValue= myInt.ToString();
                        context.My_template.InsertOnSubmit(dbMy_template);
                        context.SubmitChanges();
                    }
                    catch (Exception ex)
                    {
                        // Do nothing for now
                    }
           }
        }

Thank you for all your help on this.


SQL Server Compact 3.5 and Delphi 7

$
0
0

We have an old application that was written in Delphi 7. It is currently connected to an old Oracle Lite database that is being retired. The powers that be have chosen to move the data to a Microsoft SQL Server Compact database instead. After spending a good amount of time moving everything over to the SQL CE database, I am now tasked with getting the Delphi application to play nice with the new databases.

The people who are supposed to be smarter than I am (my boss), tell me that I should be able to simply modify the connection and everything should be back in order. However, I have been banging my head against my monitor for two days trying to get the ADO connection in the Delphi application to work with our new SQL CE database.

A slightly simplified example of what I'm working with:

The connection is made in a global object with a TADOConnection named "adoConn":

procedure TGlobal.DataModuleCreate(Sender: TObject);
begin
    adoConn.ConnectionString := 'Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=path\db.sdf;';
    adoConn.Connected := True;
end;

Shortly after this, a procedure is called to populate some messages. In an effort to trouble shoot the application, I've simplified the code to make a simple query and show the results in a message box. The procedure receives a parameter for the SQL string, but I'm ignoring it for now and manually inserting a simple select statement:

procedure Select(const SQL: string);
var
    adoQuery : TADOQuery;
begin
    adoQuery := TADOQuery.Create(nil);
    try
        adoQuery.Connection := Global.adoConn;
        adoQuery.SQL.Text := 'select * from CLT_MESSAGES';
        adoQuery.ExecSQL;
        While not adoQuery.Eof do
        begin
            // Here I just created a MessageDlg to output a couple of fields.
            adoQuery.Next;
        end;
    finally
        adoQuery.Free;
    end;
end;

Everything compiles just fine, but when I run the application I get the following error:

"Multiple-step operation generated errors. Check each status value."

I've done some additional trouble-shooting and found that the error is happening at adoQuery.ExecSQL. I've tried several different versions of the connection string and a couple different ways of trying to query the data, but it all ends up the same. I either can't connect to the database or I get that stupid "Mutliple-step" error.

I appreciate, in advance, any assistance that can be offered.

UPDATE:

I realized that the adoQuery.ExecSQL command was incorrect.  I replaced that with adoQuery.Open (I also tried adoQuery.Active := True).  Using the Open command removed the "Multiple-step" error, but now I'm getting an error stating "Object was open".

In an attempt to make things more simple and to try to dig a little deeper, I created a new application:

{$APPTYPE CONSOLE}

uses
   ActiveX, ComObj, AdoDb, SysUtils;

procedure Test;
Var
   AdoQuery : TADOQuery;
begin
   AdoQuery := TADOQuery.Create(nil);
   try
      AdoQuery.ConnectionString := 'Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=path\db.sdf';
      AdoQuery.SQL.Text := 'select * from CLT_MESSAGES';
      AdoQuery.Open;
      While not AdoQuery.Eof do
      begin
         Writeln('I formatted some text to output a couple of fields');
         AdoQuery.Next
      end;
   finally
      AdoQuery.Free;
   end;
end;

begin
   try
      CoInitialize(nil);
      try
         Test;
      finally
         CoUninitialize;
      end;
   except
      on E : EOleException do
         Writeln(Format('EOleException %s %x', [E.Message,E.ErrorCode]));
      on E : Exception do
         Writeln(E.ClassName, ':', E.Message);
   end;
   Writeln('Press Enter to Exit');
   Readln;
end.

This new code removes the TADOConnection object and inserts the ConnectionString into the TADOQuery.  Unfortunately, I am getting the same error ("Object was open") at the AdoQuery.Open command.

SQL Server on Windows RT (i.e. for ARM)

$
0
0

Hi.  We have an application we would like to port to Windows RT, but it uses SQL Compact with Replication.  The only thing standing in our way is that SQL Server isn't yet available in any form (Express, Compact, etc) on Windows RT / for ARM.  The code is all written in WPF and .NET, so it would be a trivial port.  And obviously we don't want to switch to a competitor's SQL technology, like SQL Lite (already available on Windows RT), nor rewrite our own replication & sync mechanism.

So... what's the gameplan or roadmap to release SQL Compact on Windows RT?  I can only imagine it's in the works, but I'd really appreciate at least some guess as to a timeframe.

Thanks!!

Issue with GAC and Microsoft SQL Server Compact 4.0

$
0
0

Hello

I have an application that I developed using VS Express 2012 for Windows Desktop.  It worked fine the first time it was installed in a Windows 8 computer.  Then I made changes and now I can not get the new version to install.  I get the following message "No se puede instalar ni ejecutar esta aplicación. Debe instalar primero el ensamblado Microsoft.SqlServerCe versión 4.0.0.0. en la cache de ensamblados global (GAC)"

What do I need to do to fix this problem?  Could it be because I am developing in English and the user uses it in Spanish?

Thank you.

Cancel retrieve value when trying to get a singel column from a specific row using 'select .... where ...=@key

$
0
0

Hi:

I'm trying to retrieve a totals column from a table and having problems.  The table exists and contains a single row with 12 columns each containing a value.  when I execute the following code, I get 'no data exists for row/column.  I'm stupid so I can't see where I am getting wrong.  Can you PLEASE help?

       Dim key_value As String = Nothing

        Dim con As New SqlCeConnection("Data Source=" + sqlcedb)
        con.Open()
        Try
            cmd = New SqlCeCommand("Select rt_total from register_drawer where rt_id=@id", con)
            cmd.Parameters.AddWithValue("@id", selected_date)
            rdr = cmd.ExecuteReader
            rdr.Read()
            rdr.Close()
            key_value = rdr.Item(12)
            MsgBox(key_value)
            Txt_olddrawer.Text = rdr.GetString(12) '("rt_total")
        Catch ex As Exception
            register_drawer_read_err = register_drawer_read_err + ex.Message
            MsgBox(register_drawer_read_err, , msgtitle)
            MsgBox(key_value)
        End Try
        'rdr.Close()
        con.Close()

updates Not Pushed from SQL Server 2008 to SQL CE 3.5 using Microsoft Sync

$
0
0

Hi

I am using Sync frame work with Download only Option from sql server 2008 - SQL SERVER CE 3.5

For past 2 days Sync is not updating records in  SQL CE 3.5 that was updated in sql server 2008.

This was working previously. Stopped updating for past 2 days.

When i try to delete SDF File and re-create it  a new sdf file is created  and i could see the records   

My code is as below

SyncAgent sampleSyncAgent = new SyncAgent(syncTables, false);

SyncStatistics syncStatistics = sampleSyncAgent.Synchronize();

IN SyncAgent  class i have code as below in the constructor    

             this.LocalProvider = new ClientSyncProvider();
            this.RemoteProvider = new ServerSyncProvider(tablestoSync, pBatchSync);
            SyncGroup syncGroup = new SyncGroup("ABC");;

foreach (var tables in tablestoSync )

{

  SyncTable syncTable = new SyncTable(tables.Tablename);
                syncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable; //UseExistingTableOrFail; // 
                syncTable.SyncDirection = SyncDirection.DownloadOnly;
                syncTable.SyncGroup = syncGroup;
                this.Configuration.SyncTables.Add(syncTable);

}

This   was previously working but suddenly stopped syncing. 

Sql-Server-Ce Database saving problem

$
0
0
Straight to the problem,
I have 4 tabels, they are linked like that
1<--2<--3<--4
The 4rth one cannot exist without 3rd one etc.
I named my 3rd table Statistic and the 4rth one Data, Statistic contains avg values made from data. 
Im responsible for synchro with the cloud.
Updating ea Data on local is problematic when it comes to thousands of datas so i thought of deleting all the data for the statistic and inserting whole package of data at once when the synchro is completed, wich goes rly fast.

I delete all the data with   "all data delete"
private void deleteAlldata(){
Statistic ss = ActiveStat;            var dat = from Data d in LocalDatabase.Datas where d._statisticId == ss.StatisticId select d;            LocalDatabase.Datas.DeleteAllOnSubmit(dat.ToList());            LocalDatabase.SubmitChanges();
}


            

It goes, no errors.
Now It want to update Statistic Table. Here I get an Error.

Error# >An attempt was made to remove a relationship between a Car and a Statistic. However, one of the relationship's foreign keys (Statistic._carId) cannot be set to null.



I'm sure that I'm not doing anything with the Statistic Table.
I downloaded the data from my local database and checked it.
Everything was at it should be, Data was updated, it had all required fields, Statistic had everything it should, expect the last thing where it does crash.
I can't update anything in the statistc table after the "all data delete"

Defintion of my sync column in Statistic:

[Column(DbType = "int" ,CanBeNull = true)]     public int Synced      {           get { return _synced; }           set            {                   NotifyPropertyChanging("Synced");                   _synced = value;                   NotifyPropertyChanged("Synced");                          }       }



and the definition of my linking column with the other 2nd one (remeber 1<-2<-3<-4)

[Column]
internal int _carId;

[Association(Storage = "_car", ThisKey = "_carId", OtherKey = "CarId", IsForeignKey = >true)]       public Car LinkedCar       {           get { return _car.Entity; }           set           {               NotifyPropertyChanging("LinkedCar");               _car.Entity = value;               if (value != null)               {                   _carId = value.CarId;               }               NotifyPropertyChanging("LinkedCar");           }       }



I'm not sure if it has anything to it but I work on application for windows phone 8 platform

Problem With Simple Microsoft.SQLSERVER.CE.OLEDB.3.5 Update Query Using Native Code / ATL

$
0
0

   I am trying to write a "simple" UPDATE query using the following native code that I have cobbled together from examples. The code compiles and runs without error and the results indicate that several rows were updated but the changes were not written to the DB. What in the #$%^#@% amd I doing wrong ?? Thanks for any help. TB

#define ROUNDUP(size) ROUNDUP_(size, 8)

void MyExample() { HRESULT hr = NOERROR; IDBCreateCommand * pIDBCrtCmd = NULL; ICommandText * pICmdText = NULL; ICommandPrepare * pICmdPrepare = NULL; ICommandWithParameters * pICmdWParams = NULL; ULONG ulNumCols; IAccessor * pIAccessor = NULL; ULONG cParams; DBPARAMINFO * rgParamInfo = NULL; WCHAR* pNamesBuffer = NULL; BYTE * pData = NULL; ULONG cbRowSize; DBPARAMS params; HACCESSOR hAccessor; hr = CoInitialize(0); DBBINDING* rgBindings = (DBBINDING*)CoTaskMemAlloc( sizeof(DBBINDING) * 2 ); memset( rgBindings, 0, sizeof(DBBINDING) * 2 ); CComPtr<IDBInitialize> spIDBInitialize; hr = spIDBInitialize.CoCreateInstance(OLESTR("Microsoft.SQLSERVER.CE.OLEDB.3.5")); CComPtr<IDBProperties> spIDBProperties; hr = spIDBInitialize->QueryInterface(IID_IDBProperties, (void**) &spIDBProperties); CComVariant varDataSource(OLESTR("MySQLCEDB.sdf")); CComVariant varPassword(OLESTR("MyPword")); DBPROP sscedbprop = { DBPROP_SSCE_DBPASSWORD, DBPROPOPTIONS_REQUIRED, 0, DB_NULLID, varPassword }; DBPROP dbprop = { DBPROP_INIT_DATASOURCE, DBPROPOPTIONS_REQUIRED, 0, DB_NULLID, varDataSource }; DBPROPSET dbpropset[2]; // Initialize property set. dbpropset[0].guidPropertySet = DBPROPSET_DBINIT; dbpropset[0].rgProperties = &dbprop; dbpropset[0].cProperties = 1; dbpropset[1].guidPropertySet = DBPROPSET_SSCE_DBINIT; dbpropset[1].rgProperties = &sscedbprop; dbpropset[1].cProperties = 1; hr = spIDBProperties->SetProperties(2, dbpropset); hr = spIDBInitialize->Initialize(); CComPtr<IDBCreateSession> spIDBCreateSession; hr = spIDBInitialize->QueryInterface(IID_IDBCreateSession, (void**) &spIDBCreateSession); hr = spIDBCreateSession->CreateSession(NULL,IID_IDBCreateCommand,(IUnknown**)&pIDBCrtCmd); hr = pIDBCrtCmd->CreateCommand(NULL,IID_ICommandWithParameters, (IUnknown**)&pICmdWParams); hr = pICmdWParams->QueryInterface( IID_ICommandText,(void**)&pICmdText); hr = pICmdWParams->QueryInterface( IID_ICommandPrepare,(void**)&pICmdPrepare); LPCTSTR wSQLString = L"UPDATE MyTable SET Name = ? WHERE Name = ?"; hr = pICmdText->SetCommandText( DBGUID_DBSQL, wSQLString ); hr = pICmdPrepare->Prepare(1); hr = pICmdWParams->GetParameterInfo(&cParams, &rgParamInfo, &pNamesBuffer); hr = pICmdText->QueryInterface( IID_IAccessor, (void**)&pIAccessor); DWORD dwOffset = 0; rgBindings[0].iOrdinal = 1; rgBindings[0].obStatus = dwOffset; rgBindings[0].obLength = dwOffset+sizeof(DBSTATUS); rgBindings[0].obValue = dwOffset+sizeof(DBSTATUS); + sizeof(ULONG); rgBindings[0].pTypeInfo = NULL; rgBindings[0].pObject = NULL; rgBindings[0].pBindExt = NULL; rgBindings[0].dwPart = DBPART_VALUE | DBPART_STATUS | DBPART_LENGTH; rgBindings[0].dwMemOwner = DBMEMOWNER_CLIENTOWNED; rgBindings[0].eParamIO = DBPARAMTYPE_INPUTOUTPUT; rgBindings[0].cbMaxLen = sizeof(WCHAR) * 100; rgBindings[0].dwFlags = 0; rgBindings[0].wType = DBTYPE_WSTR; rgBindings[0].bPrecision = 0; rgBindings[0].bScale = 0; dwOffset = rgBindings[0].cbMaxLen + rgBindings[0].obValue; dwOffset = ROUNDUP( dwOffset ); rgBindings[1].iOrdinal = 2; rgBindings[1].obStatus = dwOffset; rgBindings[1].obLength = dwOffset + sizeof(DBSTATUS); rgBindings[1].obValue = dwOffset + sizeof(DBSTATUS) + sizeof(ULONG); rgBindings[1].pTypeInfo = NULL; rgBindings[1].pObject = NULL; rgBindings[1].pBindExt = NULL; rgBindings[1].dwPart = DBPART_VALUE | DBPART_STATUS | DBPART_LENGTH; rgBindings[1].dwMemOwner = DBMEMOWNER_CLIENTOWNED; rgBindings[1].eParamIO = DBPARAMTYPE_INPUTOUTPUT; rgBindings[1].cbMaxLen = sizeof(WCHAR) * 100; rgBindings[1].dwFlags = 0; rgBindings[1].wType = DBTYPE_WSTR; rgBindings[1].bPrecision = 0; rgBindings[1].bScale = 0; cbRowSize = rgBindings[1].obValue + rgBindings[1].cbMaxLen; hr = pIAccessor->CreateAccessor( DBACCESSOR_PARAMETERDATA, 2, rgBindings, cbRowSize, &hAccessor, NULL ); pData = (BYTE*) malloc( cbRowSize ); memset( pData, 0, cbRowSize ); WCHAR* new_value = L"NewName"; WCHAR* old_val = L"OldName"; *(DBSTATUS*)(pData + rgBindings[0].obStatus) = DBSTATUS_S_OK; wcscpy( (WCHAR*)(pData + rgBindings[0].obValue), new_value ); *(ULONG*)(pData + rgBindings[0].obLength) = sizeof(WCHAR) * wcslen( new_value ); *(DBSTATUS*)(pData + rgBindings[1].obStatus) = DBSTATUS_S_OK; wcscpy( (WCHAR*)(pData + rgBindings[1].obValue), old_val ); *(ULONG*)(pData + rgBindings[1].obLength) = sizeof(WCHAR) * wcslen( old_val ); params.pData = pData; params.cParamSets = 2; params.hAccessor = hAccessor; DBROWCOUNT row_count; hr = pICmdText->Execute( NULL, IID_NULL, &params, &row_count, NULL ); // when I run this, row_count is set to 5 indicating 5 rows were affected but the changes // do not appear in the DB file. // What am I doing wrong ????? }




SQL Server Compact 4.0 connect slow with invalid HTTP proxy settings

$
0
0

Opening a connection to a local SQL Server Compact 4.0 database file (C#, EF 5.0) takes approx. 15 seconds if either the machine wide proxy settings (netsh winhttp set proxy...) are wrong or the local user's HTTP proxy settings (in Internet Explorer - Options - Connections) are either wrong or set to "Automatically detect proxy settings".

Why? What is SQL Server Compact doing on the network? It should just open a local database file.


Additional info: The platform is Windows Server 2008 R2. The application is a 32-bit program.

vsjitdebugger.exe

$
0
0

Hi,

I am using a program called 'Nero Vison' is a Dvd movie making and burninng program. Everytime I start it up it crashes. I have been working with their tech support to resolve the problem. They say based on the cab log files I sent them the following:

Dear Roger,

We could see that at the same time Nero Video crashes  the "vsjitdebugger.exe" hangs. Do you run this debugger when you try to use Nero Video ? If yes then we have to say that this might be the ccause of this crash and yo should disable it if you want to use Nero Video.

Please tell us if this is the case.

 I have been doing searches as to how to disable the 'vsjitdebugger.exe' with no luck.

As for my computer, i did have MS Visual Studio 2010 (trial) installed to run some diagnostics last year. I removed it yesterday, not sure if it fully removed properly though. As far as MS SQL Servers (I believe these are trials too, unless there part of another program?) I have MS SQL Server 2005 Compact Edition installed, and a whole bunch MS SQL Server 2008 with various names, listed in the 'programs and features tab' folder. Not sure where all of these came from? Are they part of  MS VS 2010 install?

Anyways, i dont know what 'vsjitdebugger.exe' is? Do I need it? can I uninstall or disable it?

I'm running Windows 7 Pro 64bit.

By messing around with that file will it screw up my Windows 7?

Can i get rid of all the sql servers too?

I really would like to fix this issue....

Thanks,

Roger

 

Detect connections to the sql compact database

$
0
0
Is there a way to see if there are connections opened to a sql compact database

SQL Server CE 3.5.1.50 in Project conflicts with 3.5.1.0 in GAC

$
0
0

I am trying to publish a VS 2012 project and are using SQL Compact 3.5.1.50 and EF 4.0.  I have read all of EricEJ's articles (http://erikej.blogspot.com/2012/05/private-deployment-of-sql-server.html) on how to get Private deployment to work.  Thanks to his articles, I have worked through several problems.  But the problem that I am having now is that on my Dev machine my GAC has 3.5.1.0 installed and when EF project is called I get the error:

[A]System.Data.SqlServerCe.SqlCeConnection cannot be cast to [B]System.Data.SqlServerCe.SqlCeConnection. 
Type A originates from 'System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91' in the context 'Default' at location '\CustomerApplicationWPF\bin\Debug\System.Data.SqlServerCe.dll'. 
Type B originates from 'System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\System.Data.SqlServerCe\3.5.1.0__89845dcd8080cc91\System.Data.SqlServerCe.dll'.

If I try to use the install on a different machine, I get the error:

The file 'C:\Users\xxx\AppData\Local\Temp\Deployment\6C6J1Q4E.CW7\6BDZDO78.1XR\System.Data.SqlServerCe.dll' already exists.

I have tried:

* Upgrading my GAC System.Data.SqlServerCe to 3.5.1.50, but it did not change the version

* Uninstalling System.Data.SqlServerCe 3.5.1.0 in the GAC

* Changing the App.Config DbProviderFactories to use 3.5.1.0

Nothing works.  I usually get a message on the non-Dev machine that System.Data.SqlServerCe must be first installed in the GAC, which I do not want to do.

SQL Compact Edition 4.0 2914,GetFileDACL,GetFileSecurity Error

$
0
0

Hello there, i have encountered this kind of issue :

 

Inner Exception 1
Type:        System.Data.SqlServerCe.SqlCeException
Message:     Internal error: SQL Server Compact made an unsupported request to the host operating system. [ 2914,GetFileDACL,GetFileSecurityW ]
Source:      SQL Server Compact ADO.NET Data Provider
Stack Trace: at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
   at System.Data.SqlServerCe.SqlCeConnection.Open()
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

It is strange because on client machine it just came out of nowhere (probably something did happen, but i have no clue at all). And as there is no information provided about this particular case/error i am forced to ask for help here. Any help or clues are apreciated.

Regards,

Vidas Vasiliauskas

Connection to SQL Server Compact 4.0 from SSMS

$
0
0

I have been following connecting to SQL Compact for eventual use for a number of years:

Get your full dose of SQL Server compact from the following links:
http://hodentek.blogspot.com/2011/01/sql-server-compact-problems.html
http://hodentek.blogspot.com/2010/07/sql-server-compact-35-with-sql-server.html
http://hodentek.blogspot.com/2008/07/sql-server-2008-rc0-and-visual-studio.html
http://hodentek.blogspot.com/2010/07/connecting-to-sql-server-ce-from-visual.html
http://hodentek.blogspot.com/2009/11/connecting-to-sql-server-compact-from.html
http://hodentek.blogspot.com/2010/08/are-you-ready-to-see-light-with.html
http://hodentek.blogspot.com/2008/04/new-data-flow-destinations-in-vs-2008s.html

I have the same story as the others. There is no selection list item for SQL Server Compact 4.0 (or for that matter SQL Server Compact). In previous version there was the possibility as in this article

http://www.sswug.org/articles/viewarticle.aspx?id=50315

In SQL Server Management Studio 11.0.2100.60 it is not possible to make a connection to SQL Server Compact 4.0.

In trying to Report out of SQL Server Compact 4.0, Visual Studio 2012 (for example Microsoft Visual Basic 2012), it is possible to connect to SQL Server Compact 4.0. However, the field names of the database objects are not CLS compliant as shown in on of the error messages copied here:

"Error 1 A field in the dataset ‘DataSet1’ has the name ‘Product ID’. Field names must be CLS-compliant identifiers. c:\users\mysorian\documents\visual studio 2012\Projects\WebRV2012\WebRV2012\Report1.rdlc WebRV2012.

Is there any reason why Microsoft did not provide connecting to SQL Server Compact from SSMS (latest) apart from negiligence?


mysorian

Upgrade SQL Server compact 3.5 to 4.0

$
0
0

Hi,

I am not to able run my VB project since it was giving error saying upgrade your databasa file from 3.5 to 4.0. The following error message i am getting ..

Warning1 This project references an earlier version of SQL Server Compact that has no designer support in this version of Visual Studio. To continue without designer support, download SQL Server Compact 3.5 from the Microsoft Download Center (http://go.microsoft.com/fwlink/?LinkId=229598). To upgrade your assets to SQL Server Compact 4.0 and enable designer support, open the project and use the Add Connection dialog box to create a connection to the database.00 LibraryManagementSystem

Could you please some guide to sort out this problem


Data directory para archivo

$
0
0

buenas noches la consulta es simple

tengo un botón el cual copia el archivo de base de datos que esta en el data directory del programa a el disco c:

la pregunta es como escribo el path del data directory 

string sourcePath = @"Data Source = DataDirectory\"; ???? ya he intentado de varias formas y no logro hacerlo

me dice que la ruta no esta completa

desde ya muchas gracias


fer

How to diagram a SQL Server Compact Edition 3.5 database?

$
0
0

Hi, is there any way to design or diagram a SQL CE database? Can you design the database in Management Studio and somehow convert it to a CE database?  Thanks

Installation of SQL Compact Server Tools 3.5 SP2 32-bit fails.

$
0
0

Hi

When I tries to install the 32-bit version of SQL Compact Server Tools (3.5 SP2) on Win 7 pc with SQL Server 2012 SP1 installed with all components (also SQL Server Replication), I got this error in SQL Server Requirement "You must first install the Replication Components for SQL Server 2005 or SQL Server 2008 or SQL Server 'Denali'".

Installation of the 64-bit version works fine.

Has anyone an idea?

Is it possible to use Synonyms in SqlServerCE?

$
0
0

Hi,

does anyone know how to create and use synonymy in SqlServer CE 3.5.1/4.0

Is it possible ? I need it to build a Workaround in EF to create one EDMX from Multiple Databases.

kind regards

Execute DELETE using ADO c++

$
0
0
hr = dbc.igt->GetInterfaceFromGlobal(dbc.dwConnectionCookie, __uuidof(_Connection), (void **) &pConn);
if( hr == S_OK )
{
	hsTimer.startTimer();
	if( strstr( session.sSqlStatement, "DELETE" ) != NULL )
	{
		pConn->CommandTimeout = 60*5;//set a 5 minute timeout for deletes
		pRecordPtr = pConn->Execute((_bstr_t)(session.sSqlStatement),NULL, adCmdText);
	}
	else
		pRecordPtr = pConn->Execute((_bstr_t)(session.sSqlStatement),NULL, adCmdText|adExecuteNoRecords);
	sDebugStr.Format("Time for SQL [%2.6f] ms", hsTimer.stopTimer() );
	dt.trace(file, sDebugStr);
	dbc.lastAccessTime = time(NULL);
	globalCookie.updateCookie(dbc);
}
else
	dt.trace("Local Execute Failed");

This code works perfectly in Win7. However, when I compile and run on WinXP, I get an ADO COM error.

The SQL Statement is "DELETE from TableLogVariable_ROTARY_SPEED".

The error I get in Win XP is " [Microsoft SQL Server Compact OLE DB Provider] [The command contained one or more errors. [,,,,,]

ADO Version on Win XP is

Wed Jan 30 09:27:21 2013  - ADO Version        : 2.8

Wed Jan 30 09:27:21 2013  - DBMS Name          : Microsoft SQL Server Compact

Wed Jan 30 09:27:21 2013  - DBMS Version       : 03.50.0000

Wed Jan 30 09:27:21 2013  - Provider Name      : sqlceoledb35.dll

Wed Jan 30 09:27:21 2013  - Provider Version   : 03.50.0000

ADO Version on Win7 is

Wed Jan 30 07:48:30 2013  - ADO Version        : 6.1

Wed Jan 30 07:48:30 2013  - DBMS Name          : Microsoft SQL Server Compact

Wed Jan 30 07:48:30 2013  - DBMS Version       : 03.50.0000

Wed Jan 30 07:48:30 2013  - Provider Name      : sqlceoledb35.dll

Wed Jan 30 07:48:30 2013  - Provider Version   : 03.50.0000

 

Viewing all 193 articles
Browse latest View live


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