Using Up Memory With Insert On SQLServerCE
Oct 23, 2007
I have an open connection object in my mobile app. I noticed that whenever I use this to do Insert into my DB the memory in use by the application increase everytime and does not get released until I close down the app (or if I close and dispose the connection object = which I dont want to do really). Just 40 inserts will take up serveral MB of memory.
Any ideas on this?
Using version 3.0.3600.0
Some sample code (cnn is a public variable SqlCeConnetion):
Dim cmdText As String = "INSERT INTO MyTable (theName, theValue) VALUES ( 'Name','Value')"
Try
Dim cmd As SqlCeCommand = New SqlCeCommand
cmd.Connection = cnn
cmd.CommandText = cmdText
cmd.ExecuteNonQuery()
Catch
End Try
cmdText = "SELECT @@Identity"
Try
Dim cmd As SqlCeCommand = New SqlCeCommand
cmd.Connection = objCnn
cmd.CommandText = strCmd
.Id = cmd.ExecuteScalar
Catch
End Try
View 3 Replies
ADVERTISEMENT
Feb 22, 2008
Hi All
I decided to change over from Microsoft Access Database file to the New SQLServerCe Compact edition. Although the reading of data from the database is greatly improved, the inserting of the new rows is extremely slow.
I was getting between 60 to 70 rows per sec using OLEDB and an Access Database but now only getting 14 to 27 rows per sec using SQLServerCe.
I have tried the below code changes and nothing seams to increase the speed, any help as I would prefer to use SQLServerCe as the database is much smaller and I€™m use to SQL Commands.
Details:
VB2008 Pro
.NET Frameworks 2.0
SQL Compact Edition V3.5
Encryption = Engine Default
Database Size = 128Mb (But needs to be changes to 999Mbs)
Where Backup_On_Next_Run, OverWriteQuick, CompressAns are Booleans, all other column sizes are nvarchar and size 10 to 30 expect for Full Folder Address size 260
TRY1
Direct Insert Using Data Adapter.
Me.BackupDatabaseTableAdapter1.Insert(Group_Name1, Full_Folder_Address1, File1, File_Size_KB1, Schedule_To_Run1, Backup_Time1, Last_Run1, Result1, Last_Modfied1, Last_Modfied1, Backup_On_Next_Run1, Total_Backup_Times1, Server_File_Number1, Server_Number1, File_Break_Down1, No_Of_Servers1, Full_File_Address1, OverWriteQuick, CompressAns)
14 to 20 rows per second (Was 60 to 70 when using OLEDB Access)
TRY 2
Using Record Sets
Private Sub InsertRecordsIntoSQLServerce(ByVal Group_Name1 As String, ByVal Full_Folder_Address1 As String, ByVal File1 As String, ByVal File_Size_KB1 As String, ByVal Schedule_To_Run1 As String, ByVal Backup_Time1 As String, ByVal Last_Run1 As String, ByVal Result1 As String, ByVal Last_Modfied1 As String, ByVal Latest_Modfied1 As String, ByVal Backup_On_Next_Run1 As Boolean, ByVal Total_Backup_Times1 As String, ByVal Server_File_Number1 As String, ByVal Server_Number1 As String, ByVal File_Break_Down1 As String, ByVal No_Of_Servers1 As String, ByVal Full_File_Address1 As String, ByVal OverWriteQuick As Boolean, ByVal CompressAns As Boolean)
Dim conn As SqlCeConnection = Nothing
Dim CommandText1 As String = "INSERT INTO BackupDatabase (Group_Name, Full_Full_Folder_Adress, File1,File_Size_KB, Schedule_To_Run, Backup_Time, Last_Run, Result, Last_Modfied, Latest_Modfied, Backup_On_Next_Run, Total_Backup_Times, Server_File_Number, Server_Number, File_Break_Down, No_Of_Servers, Full_File_Address, OverWrite, Compressed) VALUES ('" & Group_Name1 & "', '" & Full_Folder_Address1 & "', '" & File1 & "', '" & File_Size_KB1 & "', '" & Schedule_To_Run1 & "', '" & Backup_Time1 & "', '" & Last_Run1 & "', '" & Result1 & "', '" & Last_Modfied1 & "', '" & Latest_Modfied1 & "', '" & CStr(Backup_On_Next_Run1) & "', '" & Total_Backup_Times1 & "', '" & Server_File_Number1 & "', '" & Server_Number1 & "', '" & File_Break_Down1 & "', '" & No_Of_Servers1 & "', '" & Full_File_Address1 & "', '" & CStr(OverWriteQuick) & "', '" & CStr(CompressAns) & "')"
Try
conn = New SqlCeConnection(strConn)
conn.Open()
Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM BackupDatabase"
cmd.ExecuteNonQuery()
Dim rs As SqlCeResultSet = cmd.ExecuteResultSet(ResultSetOptions.Updatable Or ResultSetOptions.Scrollable)
Dim rec As SqlCeUpdatableRecord = rs.CreateRecord()
rec.SetString(1, Group_Name1)
rec.SetString(2, Full_Folder_Address1)
rec.SetString(3, File1)
rec.SetSqlString(4, File_Size_KB1)
rec.SetSqlString(5, Schedule_To_Run1)
rec.SetSqlString(6, Backup_Time1)
rec.SetSqlString(7, Last_Run1)
rec.SetSqlString(8, Result1)
rec.SetSqlString(9, Last_Modfied1)
rec.SetSqlString(10, Latest_Modfied1)
rec.SetSqlBoolean(11, Backup_On_Next_Run1)
rec.SetSqlString(12, Total_Backup_Times1)
rec.SetSqlString(13, Server_File_Number1)
rec.SetSqlString(14, Server_Number1)
rec.SetSqlString(15, File_Break_Down1)
rec.SetSqlString(16, No_Of_Servers1)
rec.SetSqlString(17, Full_File_Address1)
rec.SetSqlBoolean(18, OverWriteQuick)
rec.SetSqlBoolean(19, CompressAns)
rs.Insert(rec)
Catch e As Exception
MessageBox.Show(e.Message)
Finally
conn.Close()
End Try
End Sub
€™20 to 24 rows per sec
TRY 3
Using SQL Commands Direct
Private Sub InsertRecordsIntoSQLServerce(ByVal Group_Name1 As String, ByVal Full_Folder_Address1 As String, ByVal File1 As String, ByVal File_Size_KB1 As String, ByVal Schedule_To_Run1 As String, ByVal Backup_Time1 As String, ByVal Last_Run1 As String, ByVal Result1 As String, ByVal Last_Modfied1 As String, ByVal Latest_Modfied1 As String, ByVal Backup_On_Next_Run1 As Boolean, ByVal Total_Backup_Times1 As String, ByVal Server_File_Number1 As String, ByVal Server_Number1 As String, ByVal File_Break_Down1 As String, ByVal No_Of_Servers1 As String, ByVal Full_File_Address1 As String, ByVal OverWriteQuick As Boolean, ByVal CompressAns As Boolean)
Dim conn As SqlCeConnection = Nothing
Dim CommandText1 As String = "INSERT INTO BackupDatabase (Group_Name, Full_Full_Folder_Adress, File1,File_Size_KB, Schedule_To_Run, Backup_Time, Last_Run, Result, Last_Modfied, Latest_Modfied, Backup_On_Next_Run, Total_Backup_Times, Server_File_Number, Server_Number, File_Break_Down, No_Of_Servers, Full_File_Address, OverWrite, Compressed) VALUES ('" & Group_Name1 & "', '" & Full_Folder_Address1 & "', '" & File1 & "', '" & File_Size_KB1 & "', '" & Schedule_To_Run1 & "', '" & Backup_Time1 & "', '" & Last_Run1 & "', '" & Result1 & "', '" & Last_Modfied1 & "', '" & Latest_Modfied1 & "', '" & CStr(Backup_On_Next_Run1) & "', '" & Total_Backup_Times1 & "', '" & Server_File_Number1 & "', '" & Server_Number1 & "', '" & File_Break_Down1 & "', '" & No_Of_Servers1 & "', '" & Full_File_Address1 & "', '" & CStr(OverWriteQuick) & "', '" & CStr(CompressAns) & "')"
Try
conn = New SqlCeConnection(strConn)
conn.Open()
Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = CommandText1
'cmd.CommandText = "INSERT INTO BackupDatabase (€¦"
cmd.ExecuteNonQuery()
Catch e As Exception
MessageBox.Show(e.Message)
Finally
conn.Close()
End Try
End Sub
€˜ 25 to 30 but mostly holds around 27 rows per sec I
Is this the best you can get or is there a better way. Any help would be greatly appericated
Kind Regards
John Galvin
View 3 Replies
View Related
Mar 18, 2008
Hi,
we just migrated to SqlServerMobile 3.5. My first experience is that Version 3.5 is much slower than 3.1.
I upgraded and compacted an existing Database. Is it recommended to create a new database, instead?
Has anybody else the feeling that Version 3.5 is slower?
Are there any settings to speed up the database.
Many thanks,
Stefan
View 2 Replies
View Related
May 10, 2006
Hi,
I am trying to make a mobile application work, but I get the following error. The operating system on Pocket PC is Microsoft® Windows Mobile„¢ 2003 Second Edition. Any ideas? Thanks in advance.
The followings are the error and my codes:
System.TypeLoadException was unhandled
Message="Could not load type 'System.Data.SqlServerCe.SqlCeDataAdapter' from assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91'."
StackTrace:
at SQLMobile.Form1.Form1_Load()
at System.Windows.Forms.Form.OnLoad()
at System.Windows.Forms.Form._SetVisibleNotify()
at System.Windows.Forms.Control.set_Visible()
at System.Windows.Forms.Application.Run()
at SQLMobile.Form1.Main()
Codes:
Private Sub FillGrid()
Dim filename As New String _
("Program FilesSQLMobilesqlmobile.sdf")
Dim conn As New SqlCeConnection("Data Source=" + filename)
Dim selectCmd As SqlCeCommand = conn.CreateCommand()
selectCmd.CommandText = "select Destination from flightdata"
Dim adp As New SqlCeDataAdapter(selectCmd)
Dim ds As New DataSet()
adp.Fill(ds)
DataGrid1.DataSource = ds
End sub
View 1 Replies
View Related
Feb 15, 2007
Hi~, I have 3 questions about memory based bulk copy.
1. What is the limitation count of IRowsetFastLoad::InsertRow() method before IRowsetFastLoad::Commit(true)?
For example, how much insert row at below sample?(the max value of nCount)
for(i=0 ; i<nCount ; i++)
{
pIFastLoad->InsertRow(hAccessor, (void*)(&BulkData));
}
2. In above code sample, isn't there method of inserting prepared array at once directly(BulkData array, not for loop)
3. In OLE DB memory based bulk copy, what is the equivalent of below's T-SQL bulk copy option ?
BULK INSERT database_name.schema_name.table_name FROM 'data_file' WITH (ROWS_PER_BATCH = rows_per_batch, TABLOCK);
-------------------------------------------------------
My solution is like this. Is it correct?
// CoCreateInstance(...);
// Data source
// Create session
m_TableID.uName.pwszName = m_wszTableName;
m_TableID.eKind = DBKIND_NAME;
DBPROP rgProps[1];
DBPROPSET PropSet[1];
rgProps[0].dwOptions = DBPROPOPTIONS_REQUIRED;
rgProps[0].colid = DB_NULLID;
rgProps[0].vValue.vt = VT_BSTR;
rgProps[0].dwPropertyID = SSPROP_FASTLOADOPTIONS;
rgProps[0].vValue.bstrVal = L"ROWS_PER_BATCH = 10000,TABLOCK";
PropSet[0].rgProperties = rgProps;
PropSet[0].cProperties = 1;
PropSet[0].guidPropertySet = DBPROPSET_SQLSERVERROWSET;
if(m_pIOpenRowset)
{
if(FAILED(m_pIOpenRowset->OpenRowset(NULL,&m_TableID,NULL,IID_IRowsetFastLoad,1,PropSet,(LPUNKNOWN*)&m_pIRowsetFastLoad)))
{
return FALSE;
}
}
else
{
return FALSE;
}
View 6 Replies
View Related
Jul 29, 2014
I am doing a performance testing for In-memory option is sql server 2014. As a part I want to insert 500 million rows of records into a in-memory enabled test table I have created.
I need a sample script to insert 500 million records into a table ....
View 9 Replies
View Related
Oct 4, 2006
Hello, Iam devloping a product for a mobile unit using Windows mobile database. (*.sdf)
Is it possible from other form applictions, such as ordernary Windows forms ?
Have a wonderful day!
View 1 Replies
View Related
Apr 11, 2007
hi,
i was facing problem in sqlceserver connection, the coding i had code as below, it's return an error message "Procedure Call or Argument is not valid". i was study this issue for 2 days, but i am still can't found out the cause of issue, can anyone please point out the mistake i had made? Thank.
Module Module1
Public Const local_DatabaseFile As String = "My Documents esting.sdf"
Public conn As SqlCeConnection
Dim cmd As SqlCeCommand
Public myReader As SqlCeDataReader
Public mySelectQuery As String
-----------------------------------------------------------------------
Form1
Function Check_Code()
Try
' On Error Resume Next
builtConnStr()
If conn.State = ConnectionState.Open Then
conn.Close()
End If
mySelectQuery = "SELECT * FROM Product " & _
"WHERE Item_Code = '" + txtCode.Text + "' "
conn.Open()
Dim myCommand As New SqlCeCommand(mySelectQuery, conn)
myReader = myCommand.ExecuteReader()
' Always call Read before accessing data.
If myReader.Read() Then
txtName.Text = myReader.GetString(1)
End If
myReader.Close()
conn.Close()
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Function
------------------------------------------------------------------------------
Public Sub builtConnStr()
Try
Dim local_ConnString As String
local_ConnString = "Data Source= " & local_DatabaseFile
If conn Is Nothing Then
conn = New SqlCeConnection(local_ConnString)
conn.Open()
cmd = conn.CreateCommand()
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
View 9 Replies
View Related
Jan 29, 2004
Hello,
I'have this SyBase and SQL Server example update query:
UPDATE Table1 SET
Table1.Col1 = Table2.Col1 + Table2.Col2
Table1.Col2 = -1
FROM Table2
WHERE Table1.Id = Table2.Id
If i try to execute this query under SqlServerCE 2.0 i get this error message:
Native Error:(25501)
Description: There was an error parsing the query.
How can i write this query for running it under SqlServerCE 2.0?
Many Thanks in advance!!!
Mauro
View 1 Replies
View Related
Sep 4, 2007
I registered to redistribute the runtime for SQL Server Compact edition.
I have a desktop application which uses SDF files as the database.
In VS 2008 - when I set System.Data.SqlServerCe configured to Copy Local as TRUE - sqlserverce.dll does not get inserted to my bin directory. I am assuming if I manually put the DLL file into my bin directory (and deploy it) - the DLL file will automatically be used by my app?
View 4 Replies
View Related
Mar 6, 2008
Does anybody know if sqlserverce's license is freeware or shareware??
thanks a lot!
View 1 Replies
View Related
Aug 16, 2006
I have developed a smart device application using SqlServerCE that replicates data to the backend server. I need to provide to the user a status of this replication process. I read about the "MergeSubscriberMonitor" in SQL Server but can't find it in SqlServerCe. Is this possible? Can someone please point me in the right direction?
View 6 Replies
View Related
Sep 21, 2007
I have successfully converted a MSVS 2005 Winforms Application into the MSVS 2008 beta 2. I am however having trouble getting the winmobile data tables to fill. The ODBC Paradox tables fill fine. When I converted the application I had to re create the win mobile datasource for the project. So I used the datasource wizard in 2008, it opened the winmobile5 database and told me that I would need to convert the database to 3.5. I let it overwrite the existing database and it created a new .xsd file for me for the project. When I try to load data into the database tables
this.proceduresTableAdapter.Fill(this.fB7MobileDBDataSet.Procedures);
I get the native error 28609
You are trying to access an older version of a SQL Server Compact 3.5 database. If this is a SQL Server CE 1.0 or 2.0 database, run upgrade.exe. If this is a SQL Server Compact 3.5 database, run Compact/Repair.
I have run Compact but not repair, and still get the same error.
1. What could be left in the project that ismaking it expect to open the 3.0 database instead of the 3.5 that was converted in the datasource wizard?(If I substitute an older database file I get the native error 25010 Invalid File Name. Check the database filename. )
2. Is there a way after you convert a project to then add a datasource to the project that would use the same xsd file and datasetDesigner.cs from before the conversion ?
Thanks Jon Stroh
View 2 Replies
View Related
Aug 8, 2007
Sorry being a little vague but if you can point me in the right direction.
I have just created a new VB €“ Windows Mobile 5.0 pocket PC €“ Device Application. (which will be connected to a PDA)
Do i have to use System.Data.SqlServerCe or System.Data.SqlClient to connect to my db.
View 1 Replies
View Related
Apr 24, 2007
Is it possible to talk to a SQLServerCE database from a vbs script? If so, does anyone have an example?
Thanks,
Mike
View 1 Replies
View Related
Oct 11, 2006
I believe I've encountered a compatability problems with Visual Studion CF 2, specifically with the System.Data.SQLServerCE reference when trying to run (in debug mode - Pocket PC 2003 emulation). The environment is configured as follows:
Visual Studio 2005 - Compact Framework 2.0.50727
Microsoft SQL Server 2005 Mobile Edition
The (VB) project includes the following references:
System.Data.dll V2.0.000 from Program FilesMicrosoft Visual Studio 8Smart DevicesSDKCompact Framework2.0V2.0WindowsCE
System.Data.SqlServerCE.dll V3.0.5214.0 from Program FilesMicrosoft SQL Server Mobile EditionDeviceMobileV3.0
The IDE does not sense any problems with the following code until I try to run it in debug mode using the Pocket PC 2003 emulator. The code :
Imports System
Imports System.IO
Imports System.text
Imports System.Data
Imports System.Data.SqlServerCe
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Will Test SQL")
Call testSQL()
End Sub
Private Sub testSQL()
Dim strConn As String = "Data Source = Test.sdf; Password = <password>"
Dim CEEngine As New SqlCeEngine(strConn)
CEEngine.CreateDatabase()
CEEngine.Dispose()
Dim Conn As SqlCeConnection = Nothing
Conn = New SqlCeConnection(strConn)
Conn.Open()
Dim cmd As SqlCeCommand = Conn.CreateCommand
cmd.CommandText = "CREATE TABLE MyTable (col1 int, col2 ntext)"
cmd.ExecuteNonQuery()
Conn.Close()
Exit Sub
ErrHandler:
MsgBox(Err.Number.ToString)
MsgBox(Err.Description.ToString)
End Sub
In the debugger, the program terminates at Dim CEEngine As New SqlCeEngine(strConn). The message displayed is
Can't find PInvode DLL 'sqlceme30.dll'
I've tried referencing a different version of System.Data.SqlServerCE.dll (from Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDE but the program will not even deploy to the emulator with this reference.
I encounter a Deployment/and or registration failed wit error : 0x8973190e - There is not enough space on the disk.
What versions of the following should be used?
System.dll
System.data.dll
System.data.sqlserverce.dll
View 5 Replies
View Related
Jun 1, 2006
I have a VB.net 2005 application that uses both System.Data.SqlClient and System.Data.SqlServerCe which has worked on PC2003 handhelds but falls over in Windows Mobile 5. It seems to be when I have used a SqlClient connection and then use ExecuteNonQuery on the local sdf file - the application just bombs out - no error message, nothing.
Weirdly, if I am connected to a CE database through Query Analyzer 3.0 at the same time as running this application, everything works fine. Do I need to 'initialize' something that Query Analyzer seems to be doing in order to make this work?
Most grateful for any ideas.
Thanks
Chris
View 5 Replies
View Related
Oct 2, 2007
Hello,
I've inherited a .NET CF 2.0 application at work that uses SQL CE, and as I'm digging into the build process, I'm getting confused about which version of SQL CE that is being used.
The project references System.Data.SqlServerCe (no hint path, just from wherever VS 2005 has it). When I look at the assembly in my project, the version shows up as 3.0.3600.0, but when I browse to the DLL's location on my hard drive (C:Program Files (x86)Microsoft Visual Studio 8SmartDevicesSDK\SQL ServerMobilev3.0System.Data.SqlServerCe.dll), right click the DLL and check the properties, the version shows up as 3.0.3600.0.
In our installation package, we install three SQL CE Cabs:
sqlce30.dev.ENU.ppc.wce5.armv4i.CAB
sqlce30.ppc.wce5.armv4i.CAB
sqlce30.repl.ppc.wce5.armv4i.CAB
When installed on the device, the Remove Programs dialog shows as "Microsoft SQL Mobile 2005..." is installed. We keep the cabs in a seperate location so they are not just pulled from anywhere on the hard drive.
However, when I install the same CAB files located at:
C:Program Files (x86)Microsoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0wce500armv4i, the device shows "Microsoft SQL Mobile 2005 Compa...." is installed.
In my Add References dialog, System.Data.SqlServerCe has version 3.0.3600.0, runtime v2.0.50727
Some questions:
1. Is the version 3.0.3600.0 the same between 3.0 and 3.1?
2. Given a System.Data.SqlServerCe DLL, how can I tell if it is the 3.0 or 3.1 version?
3. When upgrading my project to use 3.1, is it enough simply to upgrade my build environment? Or should I need to change the references in my project? (It appears that the 3.1 DLLs have been placed into the default locations where VS 2005 is pulling them from). I'm using VS 2005 SP1 on Vista x64.
Thanks
View 4 Replies
View Related
Feb 15, 2007
Hello All ...
I
am attempting to create a program that will run on the PocketPC 2003
environment. I have upgraded Visual Studio to SP1, I have installed SQL
Server Compact Edition on my development machine and I have installed
SQL Server Compact Edition Tools For Visual Studio on the development
machine.
I have created a new project Visual Basic - Smart
Device - Pocket PC 2003. I have created a form for user input. I build
and deploy the form to the Symbol Pocket PC to test - no connection to
data and it works.
I then add a reference to
System.Data.SqlServerCE.dll and rebuild and redeploy the application to
the handheld. When I attempt to open the form I receive the following
error:
psmPocket.exe
NotSupportedException
System.Drawing.Bitmap
at
System.Resources.ResourceReader.LoadObjectV2() at
System.Resources.ResourceReader.LoadObject() at
System.Resources.RuntimeResourceSet.GetObject() at
System.Resources.ResourceManager.GetObject() at
System.Resources.ResourceManager.GetObject() at
pmsPocket.frmSetSOPType.InitializeComponent() at
psmPocket.frmSetSOPType..ctor() at
System.Reflection.RuntimeContructorInfo.InternalInvoke() at
System.Reflection.RuntimeContructorInfo.InternalInvoke() at
System.Reflection.ContrcutorInfo.Invoke() at
System.Activator.CreateInstance() at MyForms.Create__Instance__() at
MyForms.get_frmSetSOPType() at psmPocket.SetSOPType.Main()
Now
the confusing part is that I haven't changed any of the forms or the
code behind the forms, I have simply added the reference to the project.
Any idea why adding the reference to System.Data.SqlServerCE.dll would cause the system to start generating these errors?
I've
checked, the install process has loaded the .NET 2 framework to the
handheld. And as indicated at the beginning of this message, the
application showed the form prior to my adding the reference.
Thoughts?
Thanks ...
View 3 Replies
View Related
Jul 7, 2007
I'm using SQL Server Compact Edition, but in the future I would like to be able to switch to another SQL Server Edition or even a different database. To achieve this, Microsoft recommends using DB Provider Factories (see: Writing Provider Independent Code in ADO.NET, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=674426&SiteID=1).I enumerated the available data providers on my PC with:
Code Snippet
System.Reflection.Assembly[] myAssemblies = System.Threading.Thread.GetDomain().GetAssemblies();
The important entry is:"SQL Server CE Data Provider"".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition""Microsoft.SqlServerCe.Client""Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"When executing:
Code SnippetdataFactory = DbProviderFactories.GetFactory("System.Data.SqlServerCe");
I got at first this error run time message: Failed to find or load the registered .Net Framework Data Provider.I added a reference to "Microsoft.SqlServerCe.Client" at C:ProgrammeMicrosoft Visual Studio 8Common7IDEMicrosoft.SqlServerCe.Client.dll and the program runs.Of course, it uses "Microsoft.SqlServerCe.Client" instead of "System.Data.SqlServerCe". Laxmi Narsimha Rao ORUGANTI from Microsoft writes in the post "SSev and Enterprise Library" that "Microsoft.SqlServerCe.Client" is not meant to be used and that we should add the following entry to the machine.config file:
Code Snippet<add name="SQL Server Everywhere Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
After changing the code to:
Code Snippet
dataFactory = DbProviderFactories.GetFactory("Microsoft.SqlServerCe.Client");
I get the same error message as before, even after adding a reference to "System.Data.SqlServerCe" at C:ProgrammeMicrosoft Visual Studio 8Common7IDESystem.Data.SqlServerCe.dll.Any suggestion what I should do ? Just use "Microsoft.SqlServerCe.Client" ? Anyway, I don€™t like the idea that I have to change the machine.config file, since I want to use click once deployment.
View 5 Replies
View Related
Dec 18, 2006
hi,
We are facing a problem with compact framework 1.0 and SQL CE on windows mobile 5.0 smart phone (Motorola Q).
The application was build for Windows Mobile 5.0. When we use €œSystem.Data.SQLServerCE.dll€? from €œC:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0€? in compact framework 2.0 it works fine.
Since Motorola Q has .Net Compact Framework 1.0 we need to port same application to compact framework 1.0. There is similar DLL in "C:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev2.0" but it is not working, it gives runtime error missing method at very first line of code SqlCeEngine _eng = new SqlCeEngine().
Thanks & regards,
Rashmi
View 3 Replies
View Related
Mar 29, 2007
Hi! I am having a problem getting the inserted id from a table.
Here is the table:
/*********************** Companies **********************************/
CREATE TABLE Companies(
CompanyId int IDENTITY(1,1) PRIMARY KEY,
Description nvarchar(30) NOT NULL
)
GO
When I type SELECT @@IDENTITY in SQL Management Studio after a successful insert, it works fine. However, in code (System.Data.SqlServerCe), I get an error using this code:
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = sql;
cmd.CommandType = System.Data.CommandType.Text;
ret = (int)cmd.ExecuteScalar();
I saw a thread with this solution, but do I really have to go to this trouble?
DECLARE @MyTable table
( MyIdentity int )
INSERT INTO Employees ( FirstName, LastName )
OUTPUT inserted.EmployeeID INTO @MyTable
VALUES ( 'Bill', 'Smith' )
SELECT MyIdentity
FROM @MyTable
scope_identity does not seem to work either. Am I missing something?
Thanks!
Michael
View 11 Replies
View Related
Oct 20, 2006
Hi
i have the following problem :
i attempted to connect with a SQLServerCE DataBase
to Insert and update its rows, but i noticed that i want the reference :
System.Data.SqlServerCe
i went to (Add references) but i didn't find it ..
what should i do to break this problem ?
please help me !
View 7 Replies
View Related
May 31, 2007
Hello
I have referrenced System.Data.SqlServerCE.dll to my web project in order to create a .sdf file. I haven't wrote any code,just referenced it. When I build the project I get this error:
Error 2 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' cannot be loaded.
View 2 Replies
View Related
Apr 25, 2006
Hi all,
Why System.Data.SqlserverCe.Dll doesn't appear in VS2005. In VS2003 System.Data.SqlserverCe.Dll appear to write winCE application. But it won't appear in VS2005 while am selecting PocketPc application. any body gimme the solution.
Thanks
Nat Raja
View 7 Replies
View Related
Jul 13, 2015
I am looking to test this feature - and the "Transaction Performance Collector" has recommended me a table to port to In-Memory OLTP.Â
I have now tried the "Table Memory Optimization Advisor" tool.
After a couple of tweaks to the table design - the tool is now passing validation but the tool is not allowing to progress to the next step:
Could it be down to not having enough memory? But would this not show in the advisor?
View 4 Replies
View Related
Feb 14, 2007
Hello All ...I
am attempting to create a program that will run on the PocketPC 2003
environment. I have upgraded Visual Studio to SP1, I have installed SQL
Server Compact Edition on my development machine and I have installed
SQL Server Compact Edition Tools For Visual Studio on the development
machine.I have created a new project Visual Basic - Smart
Device - Pocket PC 2003. I have created a form for user input. I build
and deploy the form to the Symbol Pocket PC to test - no connection to
data and it works.I then add a reference to
System.Data.SqlServerCE.dll and rebuild and redeploy the application to
the handheld. When I attempt to open the form I receive the following
error:psmPocket.exeNotSupportedExceptionSystem.Drawing.Bitmapat
System.Resources.ResourceReader.LoadObjectV2() at
System.Resources.ResourceReader.LoadObject() at
System.Resources.RuntimeResourceSet.GetObject() at
System.Resources.ResourceManager.GetObject() at
System.Resources.ResourceManager.GetObject() at
pmsPocket.frmSetSOPType.InitializeComponent() at
psmPocket.frmSetSOPType..ctor() at
System.Reflection.RuntimeContructorInfo.InternalInvoke() at
System.Reflection.RuntimeContructorInfo.InternalInvoke() at
System.Reflection.ContrcutorInfo.Invoke() at
System.Activator.CreateInstance() at MyForms.Create__Instance__() at
MyForms.get_frmSetSOPType() at psmPocket.SetSOPType.Main()Now
the confusing part is that I haven't changed any of the forms or the
code behind the forms, I have simply added the reference to the project.Any idea why adding the reference to System.Data.SqlServerCE.dll would cause the system to start generating these errors?I've
checked, the install process has loaded the .NET 2 framework to the
handheld. And as indicated at the beginning of this message, the
application showed the form prior to my adding the reference.Thoughts?Thanks ...
View 1 Replies
View Related
May 3, 2008
Hi All
I have a problem when trying to create reports using Crystal Reports and SQL Server Compact 3.5. The report displays the Column Headers but no information. Is there any good walk throughs for creating reports from SQL Server Compact 3.5 using Crystal Reports.
Thanks
John
View 5 Replies
View Related
Nov 30, 2005
I am trying to use SQL Mobile 2005 with Visual Studio 2005. I have a simple sql mobile db i created and am trying to test connectivity to the DB in a simple app. I added the reference to the SqlServerCE and the verison # that is shown in properties is 3.0.3600.0, but when i look at the physical DLL in explorer (found at C:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0) the version # is 3.0.5206.0, so when i compile and run the test, I get :
View 7 Replies
View Related
Aug 7, 2007
How can I tell if the System.Data.SqlServerCe assembly I am referencing is meant for Desktop use as opposed to Compact development? We are using NUnit as our testing framework and I get the following error when I attempt to execute nunit-console on my test fixture referencing SqlServerCe:
System.IO.FileLoadException : Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---->
System.IO.FileLoadException : Could not load file or assembly 'System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The unit tests run fine from inside of Visual Studio using the Resharper Unit Test Runner...
Matt
View 1 Replies
View Related
Sep 28, 2007
Hello. I have received the follwoing error upon an attempt to Browse the Cube. All other tabs are functional, including the Calculations tab. We are running Windows Server 2003 SP2 and SQL Server 2005 SP2. Any suggestions would be greatly appreciated!
**EDIT** - Have confirmed SP1 for VS2005 is installed both locally and on server, also.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Microsoft Visual Studio)
------------------------------
Program Location:
at Microsoft.Office.Interop.Owc11.PivotView.get_FieldSets()
at Microsoft.AnalysisServices.Controls.PivotTableFontAdjustor.TransformFonts(Font font)
at Microsoft.AnalysisServices.Browse.CubeBrowser.UpdatePivotTable(Boolean translate)
at Microsoft.AnalysisServices.Browse.CubeBrowser.UpdateAll(Boolean translate)
at Microsoft.AnalysisServices.Browse.CubeBrowser.InitialUpdate()
at Microsoft.AnalysisServices.Browse.CubeBrowser.SupportFunctionWhichCanFail(FunctionWhichCanFail function)
View 4 Replies
View Related
Oct 11, 2007
I've been researching AWE to determine if we should enable this for our environment.
Currently we have a quad core box with 4 gb of RAM (VMware). OS: Windows 2003 std, SQL Server 2005 std. 3GB is not set but will be as soon as we can perform maintenance on the server.
I have read mixed feedback on AWE, either it works great or grinds you to a hault. I would assume that the grinding to a hault is due to not setting the min/max values correctly or not enabling the lock page in memory setting.
We only have one instance of SQL on the server and this box won't be used for anything else aside from hosting SQL services. We do plan on running SSRS off of this server as well.
1. Will running SSRS and enabling AWE cause me problems? Will I have to reduce the max setting by the SSRS memory usage or will it share and play nice?
2. How do I go about setting the Max value? Should it be less than the physical RAM in the box? Right now its set to the default of 214748364, even if I don't enable AWE should this default value be changed?
3. It seems that even at idle the SQL server holds a lot of memory and the page file grows. If I restart the process in the morning, memory usage in taskmon is at 600mb or so. By the end of the day, its up around 2gb. How can I track down whats causing this, should this even concern me?
4. The lock Page in memory setting worries me. Everything I've read on this seems to give a warning about serious OS and other program support degradation. In some cases to the point where they have to restore the settings on the server before they can bring it back up. What are your thoughts on this.
View 3 Replies
View Related
Feb 2, 2008
Hi,
I am working on a .dll which need to access .sdf ( sql server mobile db). In my project, I added a reference "System.Data.SqlServerCe.dll". The dll is located in C:Program FilesMicrosoft Visual Studio 8Common7IDE.
I am able to compile the project. Then I created a Unit project for this dll file. In Unit project, I added the same reference.
Now the magic things happen. The compiling was failed. I got "Error 1 The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:VS2005MobileDBUnitMobileDBProjectUnitMobileDB.cs 50 13 UnitMobileDBProject".
I don't understand how come the same .dll could pass in a dll project but failed in unit test project. And I never saw the System.Data.SqlServerCe display in ".Net" Section of Add reference. But in my office, I installed same version of VS2005 for software tester. I could see the System.Data.SqlServerCe display in the ".Net" section of Add Reference.
Please help me to fix this problem. Thanks.
View 6 Replies
View Related