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

Issue with windows installer unable to complete any software installations system win 7 x64 SQL srvrs 2005 Compact Edition [ENU] & 2008,

$
0
0

So I am asking for HELLLLP with direction. Is there a test that could analyze computer? I really am trying to avoid another os re-install  it will be #6 since 12.12  can anyone help me get the repair process started?

So far errors have been associated to registry hive corrupted, windows installer not functioning as I am unable to install anything.. Software or other. Start is slow & hangs with black glowing screen while round idle thing spins; until I either click mouse or hit a key.

I am running SQL Server(s) for Windows 7 x64, SQL Server 2005 Compact Edition [ENU], SQL Server VSS Writer  & SQL Server 2008 (several different ones) 

any advice?


Error with updating one table column with reference of two tables

$
0
0

Hi,

I'm trying to update a column in a table with reference to another table. There are two tables,nt_masterinstrument and SQLSymbol. The description in nt_masterinstrument is empty and I try to update it from SQLSymbol as below:

update nt_masterinstrument
  set nt_masterinstrument.description = SQLSymbol.description
from nt_masterinstrument, SQLSymbol
where nt_masterinstrument.name = 'MF5.SI' AND nt_masterinstrument.name = SQLSymbol.name

It shows error : "There was an error parsing the query. [ Token line number = 3,Token line offset = 1,Token in error = from ]"

another error if I removed the from clause : "The column name is not valid. [ Node name (if any) = SQLSymbol,Column name = name ]"

I am using MS SQL Compact Query Analyzer.

Rgs,

Toygo

ADP_ConnectionRequired_Fill

$
0
0
Any idea what causes a System.InvalidOperationException with the message:

The resource ADP_ConnectionRequired_Fill was not found in System.Data

When in generated data set code the Fill is called:

myDBDataSet.client_case_planDataTable dataTable = new myDBDataSet.clientDataTable();
this.Adapter.Fill(dataTable);

Thanks

SQL Server Compact 3.5 SP2 Private Deployment in separate folder in project tree fails

$
0
0

I have a desktop .NET 4.0 C#  application and I'm trying to do a private deployement of SQL Server Compact 3.5 SP2. I have followed the steps described in here, here and here and it worked fine. In an attempt to improve the configuration, I followed the instructions described in this post to isolate the SQL CE files in a separated folder. However, after doing that, the application no longer works. When I try to run it, I get the following error message:

Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8080. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.

StackTrace:    at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

   at System.Data.SqlServerCe.SqlCeConnection..ctor()

   at System.Data.SqlServerCe.SqlCeProviderFactory.CreateConnection()

   at System.Data.EntityClient.EntityConnection.GetStoreConnection(DbProviderFactory factory)

   at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)

   at System.Data.EntityClient.EntityConnection..ctor(String connectionString)

   at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)

   at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)

 ...

InnerException:

System.DllNotFoundException: Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

   at System.Data.SqlServerCe.NativeMethods.GetSqlCeVersionInfo(IntPtr& pwszVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

StackTrace:    at System.Data.SqlServerCe.NativeMethods.GetSqlCeVersionInfo(IntPtr& pwszVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

InnerException: null

Here is how the files are structured in the project:

The relevant entries in the "App.config" file:

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><probing privatePath="SqlCe35SP2"/><dependentAssembly><assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/><bindingRedirect oldVersion="3.5.1.0-3.5.1.50" newVersion="3.5.1.50"/></dependentAssembly></assemblyBinding></runtime><system.data><DbProviderFactories><remove invariant="System.Data.SqlServerCe.3.5"></remove><add name="Microsoft SQL Server Compact Data Provider"
				 invariant="System.Data.SqlServerCe.3.5"
				 description=".NET Framework Data Provider for Microsoft SQL Server Compact"
				 type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/></DbProviderFactories></system.data>

I have checked the bin output and the files are corrected copied to it, mirroring the project tree.

Has any one got a clue on what is the problem here?

SQL CE, values aren't written to DB

$
0
0

Hello

I'm creating simple Windows Phone 7.1 SDK application

I need to create small database. To do so, I've installed SQL Server Compact Toolbox. I've created table named TrainingData, which contains 3 columns: ID(PK, int, not null) identity (autoincrements), Data (datetime, null), Time(nchar(15),null). After creating table I've used option Add Windows Phone Data Context to current project, which automatically created TrainingDBContext.

Now, in one page I want to save data to database on click:

private void btnSaveActivity_Click(object sender, RoutedEventArgs e)
        {
            using (TrainingDBContext context = new TrainingDBContext(TrainingDBContext.ConnectionString))
            {
                DateTime date = DateTime.Now;
                context.TrainingData.InsertOnSubmit();
            }
        }

The problem is, context sees ontly TrainingData. I can't access to data column this way: context.data.InsertOnSubmit(date) which throws this error:

Error    1    'PhoneApp1.TrainingDBContext' does not contain a definition for 'data' and no extension method 'data' accepting a first argument of type 'PhoneApp1.TrainingDBContext' could be found (are you missing a using directive or an assembly reference?)

Anyone knows solution to this problem?

Best regards

Raston



Sample code for stored procedure

$
0
0

Hi,

I need Some Sample code fro previous shift closing Total to current shift  opening Total. give me some sample code  for stored procedure

sqlceengine::createDatabase() throws exception - Access to the database file is not allowed. [ File name = ]

$
0
0

Hi,

I'm getting an exception when i try to create database (.sdf) file in network share. Network share has full permission and I'm able to create a text file in that share and save some text data into it.

While creating database, sqlceengine::CreateDatabase() throws the below exception:

"exception - Access to the database file is not allowed. [ File name =  ]" . The below connection string is used while creating sql ce engine object.

sqlceEngineObject = new SqlCeEngine("Data Source=" + filePath + ";encryption mode=platform default;Password=" + DBpassword);

Here filepath is full path to the network share.

What should be the problem? I can create/save text data file. But why I couldn't create a database (.sdf) file using sqlceengine::CreateDatabase()?

Thanks

How to AutoGenerate the Primary Key

$
0
0

Databases should come with a health warning !!!

I am using VB2010 Express and used Project Add New Item to add a SQLCE 3.5 Database.

I then created 2 Tables by right clicking on the Tables tab in Database Explorer, Leagues & Teams.

I have used the Solution Explorer to open the DataSet and add a Foreign Key. This is what I now have :

Table1 : Leagues

ID -  PK, AutoIncrement = True, 1, 1, DataType = System.Int32, Unique = True

Name

Table2 : Teams

ID -  PK, AutoIncrement = True, 1, 1, DataType = System.Int32, Unique = True

Name

LeagueID - FK, AutoIncrement = False, DataType = System.Int32, Unique = False

However, if I right-click on the Table name in Database Explorer & choose Show Table Data, so I can enter a Test entry, it gets rejected with an error message telling me that the ID column cannot be Null ... so why is it not AutoIncrementing ?!? This happens if I try to enter a Test entry into either Table ...


Database development

$
0
0

I am developing a database management program in VB 2008 Express Edition. It seems to work ok when I add new records - they are stored back in the original database, but if I look at the Tables (in the Database explorer window) the newly added records disappearand I am left with just the original records that I started with when I first set up the Table.

This happens even after saving them and verifying that they existed back in the database.

Any ideas anyone ?

I know for sure that the new records are stored in the original database (as distinct from the Dataset) because after closing the program and running it again the records are there.

They are there even after shutting down the computer and re-booting - it's only when I peep into the Tables branch of the Database in Database Explorer that this happens. ??

KarlAP


Karl A Phelan

ADO c++ Memory Leak

$
0
0

I am using ADO (c++) to insert records into a SQL CE database. Compiling on Windows XP. When I comment out the "Execute" call, the memory leak goes away. The same code running on Win7 (using msado60.tlb) has no problem.

#import "msado15.DLL" no_namespace rename("EOF", "EndOfFile")
.
.
.
HRESULT hr;
_ConnectionPtr pConn		= NULL;
IGlobalInterfaceTable	*igt;
DWORD dwConnectionCookie;
.
.
.
//I use only ONE connection for the life of the program...
hr = igt->GetInterfaceFromGlobal(dwConnectionCookie, __uuidof(_Connection), (void **) &pConn);
if( hr == S_OK )
{
	pConn->Execute((_bstr_t)(session.sSqlStatement),NULL, adExecuteNoRecords);
	pConn.Release();
	pConn = NULL;
}

SQL Server Compact 3.5 SP2 was installed with SQL Server 2008 R2 and needs to be uninstalled, are there any issues with this?

$
0
0

We have a hardened PCI environment using SQL Server 2008 R2 and our information security office recently detected SQL Server Compact 3.5 SP2 which is an unsupported product and therefore puts us at risk of PCI certification. We need to uninstall this. Are there any issues with doing so?

Also in our dev/test environment, we ran a scan against the servers, unhardened, that also have SQL Server Compact 3.5 SP2 installed and it wasn't detected. These dev/test servers are patched to the same level as our PCI production servers so why would the scan not detect SQL Server Compact 3.5 SP2?

Is it possible that somethat has activated SQL Server Compact 3.5 SP2 on our production servers and that's why the scan is detecting it? Is there a service for SQL Server Compact 2.5 SP2 and if so what is it called? If not, what will it appear as under processes in Task Manager?

Thanks.


Michael MacGregor, Senior SQL Server DBA

SQL Server Compact Crash

$
0
0

I have made an application in WPF. If I run the application directly from Visual Studio, it works fine. When I create an installer for it, I get a crash whenever the app tries to connect to the SQL Server CE. I have checked that the installer has copied all the required DLL's to the folders it needs.

The error is:

 Problem Event Name:CLR20r3

 Problem Signature 01:touchhomepage.exe
  Problem Signature 02:1.0.0.0
  Problem Signature 03:513a0735
  Problem Signature 04:System.Data.SqlServerCe
  Problem Signature 05:4.0.0.1
  Problem Signature 06:4d24a1b6
  Problem Signature 07:17b
  Problem Signature 08:12
  Problem Signature 09:System.Data.SqlServerCe.SqlCe
  OS Version:6.1.7600.2.0.0.256.48
  Locale ID:16393
  Additional Information 1:3ea6
  Additional Information 2:3ea6eedac02caad30d2f6ed8eec41ecd
  Additional Information 3:b2f4
  Additional Information 4:b2f41498039b4f85a2340b9037820a94

Get Last Month's Record (SQL Server CE)

$
0
0

Hello All,

I'm trying to convert the SQL statement below that I used with MS Access to SQL Server (COMPACT EDITION) 4.0 statement and I can't figure the darn thing out. I'm simply trying to get all records of the previous month. Please keep in mind that I'm using SQL Compact Edition 4.

Dim m_sSQL_Global_LastMonth As String = m_sSQL_Base_DR _
& " Where Month(DDate)=" & Month(Today) - 1 & " And " & "Year(DDate)= " & Year(Today) & "" _
& " ORDER BY DDate DESC, DTime_Start ASC;"

Thanks to all,

ADawn


gary

Viewing all 193 articles
Browse latest View live


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