Calculations In SQL Queries Using SQL Server Compact

Feb 1, 2008

Hi Folks,

I am looking for some help on how to do a calculation for each row returned in a query.

For example, I have the following query:

Select Name, Supplier, Colour, Cost, [Cost Inc Vat] from products;

The idea is that Cost and a variable, @vat included in part of the SQL statement (I assume), will be be used to calculate the value of the column [Cost Inc Vat] for each row, but I dont know how to do this.

Is is possible in SQL Server Compact and how can it be done?

Many thanks,

Morrislgn

View 3 Replies


ADVERTISEMENT

Queries In SQL Compact Edition

Apr 29, 2007

If my research is correct SQL CE as of this date does not support STORED PROCEDURES (queries).



If this is true, how can it hope to compete with MS ACCESS or MS Foxpro as a Desktop database.



This seems to be a lot of hype for something that appears to be totally in-adequate.



I thought this was a way to wean off of MS ACCESS.



Can someone tell me what I am missing ?



Thanks



John

View 3 Replies View Related

How To Connect ADODB With Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider For Microsoft SQL Server Compact 3.5)

Sep 12, 2007

Hi
We are checking VB 9 (Orcas).

we connected to database created under with sql server 7. with this code

Public cn As New ADODB.Connection

Public Sub OpenDB()


cn.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial catalog=Reservation;Data Source=.")

End Sub
this code worked well.
we know sql7 is not compatiable with vista. please tell us how to connect it wiith sql2005 . we downloaded orcas express edition beta. we created a database also. please let u know how to connect with Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5).

Rgds
Pramod

View 7 Replies View Related

Sqlceoledb35.dll - Error 25123 - A SQL Server Compact Edition DLL Could Not Be Loaded. Reinstall SQL Server Compact Edition.

May 5, 2008

Hello,

we've got a SQL Server 2005 which replicates with an SQL Server Compact 3.5. Every 10 to 20 synchronisations we're getting the error mentioned above. A Soft reset of the device helps to make the synchronization working again.

Why is this error happening and how can we resolve this?

BTW, we've also running system that replicates with an SQL Server Compact 3.0 without having this problems.

Thanks,
Markus

View 1 Replies View Related

A Sql Server Compact Edition DLL Could Ot Be Loaded Reinstall SQL Server Compact Edition [ DLL Name = Sqlceca30.dll]

Mar 11, 2008



Hi there,

everything is ok for first run. but i leave the program relogin
than that error occured ppc2003 second edition devices. Windows mobile 5.0 device works fine.
can anybody help me?


VS2005 ver 8.0.50727
SSCE31VSTools-ENU.exe loaded
SSCE31SDK-ENU.msi loaded

machine 1
SQL 2005 loaded

machine 2
http://192.168.20.22/ssce/sqlcesa30.dll
"Microsoft SQL Server Compact Edition Server Agent" looks fine

pocket pc side
C:Program FilesMicrosoft SQL Server Compact Editionv3.1SDKinwce400armv4

.net cf 2.0 sp2
sqlce30.dev.ENU.ppc.wce4.armv4.CAB
sqlce30.ppc.wce4.armv4.CAB
sqlce30.repl.ppc.wce4.armv4.CAB installed too.

my code
---------------------------------------------

Dim RdaStr As String = "Provider=SQLOLEDB; Data Source=" + Server + ";Initial Catalog=" + DataBase + ";Integrated Security=SSPI"

Dim rda As SqlCeRemoteDataAccess

Try

rda = New SqlCeRemoteDataAccess "THIS LINE GIVES ME THAT ERROR
Catch ex As Exception

MsgBox(ex.ToString)

Application.Exit()

End Try

Try

rda.InternetLogin = [String].Empty

rda.InternetPassword = [String].Empty

rda.InternetUrl = "http://" + IP_no + "/ssce/sqlcesa30.dll"

rda.LocalConnectionString = ConnectString

Catch ex As Exception

MsgBox("Bağlantı hatası..")

Application.Exit()

End Try
------------------------------------------------------------------------------
i added the following code to very beginning of my code too.
that code lock my device


Declare Function LoadLibrary Lib "coredll" Alias "LoadLibrary" (ByVal lpLibFileName As String) As IntPtr


Dim pt As IntPtr

pt = LoadLibrary("\windowssqlceca30.dll")

pt = LoadLibrary("\windowssqlceoledb30.dll")

pt = LoadLibrary(\windowssqlcecompact30.dll)


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

View 4 Replies View Related

Making Calculations In A Business Layer Vs Sql Server

Jan 29, 2008

Lead information fields (name, address, etc.)
 
promo_ID: the id of the web form that site visitors filled out to send us their information
PPC_source: If this lead is a result of a Pay-per-click campaingwe capture the name of the search engine
Status_ID: Shows if the lead has been contacted, quoted, sold, bad lead, etc.
I was asked to come up with a summary report calculating the number of leads under each status ID - for each PPC_source
Example:




 

Total leads   |   

Google   |   

Yahoo


Status = pending

 

 

 


Status = contacted

 

 

 


Status = quoted

 

 

 


Status = Sold

 

 

 
Looping over each record (12,000 and counting) to get the sums of each status for each pay-per-click campaign takes a while (not all campaigns / status are listed above).
The question: Is it better to retrieve all records in a dataset and do the math in the business layer or is there a way to do the math in a SQL Procedure, or function.
Thanks.

View 2 Replies View Related

SQL Server Admin 2014 :: Transaction Log And TempDB Calculations

Mar 13, 2014

Is there a formula for calculating how expensive a transaction will be in terms of disk space used before its run. I dont want it accurate to the MB, but rough enough so I can determine how much additional space to assign to a transaction log or SAN volume.

Currently we're reindexing ~25billion rows, nothing too wide, say 12 columns consisting of 1 varchar(50) and the rest ints, bits and money.Roughly speaking if I reindex the clustered index on an int indetity, (with sort_in_tempdb) how would I calculate the the disk space used?

View 2 Replies View Related

Floating Point - Precision Of Arithmetic Calculations On Server

Dec 4, 2013

I am trying to understand why SQL Server gives me significantly lower precision than many of the other sources that have tried when using the POWER function. My environment is 2008 R2 SP2 (10.50.4000.0 X64, Standard edition) on Windows 2008 X64 SP1

DECLARE @x FLOAT(53) = 1.0004;
DECLARE @y FLOAT(53) = 1.0/12.0;
SELECT POWER(@x,@y)-1; -- Answer: 3.33270904724348E-05
GO
DECLARE @x FLOAT(24) = 1.0004;
DECLARE @y FLOAT(24) = 1.0/12.0;

[URL] ....

Answer: 3.33272237835747E-05

I also tried using Windows Calculator.Answer:3.3327223783495255846580902358195e-5

And an online "high-precision" calculator from [URL] ...

Answer: 3.332722378349525584658E-5

The best SQL results compare only to the fourth digit with other results. Everything else agrees to the 10th or 12th digit.

Is the precision of arithmetic calculations on SQL Server that bad, or am I doing something wrong here? Is there another more precise alternative?

I did the following. The results speak for themselves

DECLARE @x FLOAT(53) = 1.0004;
DECLARE @y FLOAT(53) = 1.0/12.0;
DECLARE @z FLOAT(53) = POWER(@x,@y)-1; -- Answer: 3.33270904724348E-05
SELECT POWER((1+@z),12); -- 1.00039999839968

-- using results from other sources (c#, windows calc, casio.com)
SELECT POWER((1+3.33272237835747E-05),12) -- 1.0004
SELECT POWER((1+3.3327223783495255846580902358195e-5),12)-- 1.0004
SELECT POWER((1+3.332722378349525584658E-5),12) -- 1.0004

It is not important what I am trying to do, but in case it will work, I am trying to calculate the monthly return for a 90-day T-bill given the compounded annual return. x is the annualized return.

View 7 Replies View Related

SQL Server 2014 :: Using Newly Created Column For Doing Further Calculations In SAME Query

Apr 12, 2015

I am new to SQL Programming. I am learning the basics. I am trying to create a simple query like this -

SELECT
Column_1,
Column_2,
Column_3,
10*Column_1 AS Column_4,
10*Column_2 AS Column_5,

-- I am not being able to understand how to do this particular step Column_1*Column_5 As Column_6

FROM Table_1
First 3 Columns are available within the Original Table_1
The Column_4 and Column_5 have been created by me, by doing some Calculations related to the original columns.

Now, when I try to do FURTHER CALCULATION on these newly created columns, then SQL Server does not allows that.

I was hoping that I will be able to use the Newly Created Columns 4 and 5 within this same query to do further more calculations, but that does not seems to be the case, or am I doing something wrong here ?

If I have to create a new column by the name of Column_6, which is actually a multiplication of Original Column_1 and Newly Created Column_5 "I tried this - Column_1*Column_5 As Column_6", then what is the possible solution for me ?

I have tried to present my problem in the simplest possible manner. The actual query has many original columns from Table_1 and many Calculated columns that are created by me. And now I have to do various calculations that involve making use of both these type of columns.

View 8 Replies View Related

SQL Server 2012 :: Date / Time Calculations For Work-plan Times?

May 31, 2015

I have a table that stores working hrs, such as

RecID,StaffID,StartDate,EndDate
17,969,2015-05-18 00:00:00.000,2015-05-18 06:00:00.000
18,969,2015-05-18 18:00:00.000,2015-05-19 06:00:00.000
19,969,2015-05-19 18:00:00.000,2015-05-20 06:00:00.000
20,969,2015-05-20 18:00:00.000,2015-05-21 06:00:00.000
21,969,2015-05-21 18:00:00.000,2015-05-22 06:00:00.000
22,969,2015-05-22 18:00:00.000,2015-05-23 06:00:00.000
23,969,2015-05-23 14:00:00.000,2015-05-24 08:00:00.000
24,969,2015-05-24 22:00:00.000,2015-05-25 00:00:00.000

So working times can go over midnight, there can be more than one working period in a day etc.

For this staff member the summary of the weeks work will be

18/05/2015 - 12 hrs
19/05/2015 - 12 hrs
20/05/2015 - 12 hrs
21/05/2015 - 12 hrs
22/05/2015 - 12 hrs
23/05/2015 - 16 hrs
24/05/2015 - 10 hrs

Now for the complicated part, a person can take absence(sick,holiday,other) for any part of a day or whole day(s). For these absence periods only the worked time on that day needs to be negated off, not the whole period of time.

So for example

If this person

had a days holiday on the 22nd, shown in the HOLIDAY table as

StaffID,DateFrom, DateTo
969, 22/05/2015 00:00:00.000,22/05/2015 23:59:59.000

A Leave of Absence on the 20th, shown in the LEAVE table as

StaffID,DateFrom, DateTo
969,20/05/2015 12:00:00.000,20/05/2015 16:00:00.000

And was off sick on the morning of the 19th, shown in the SICKNESS Table as

StaffID,DateFrom, DateTo
969, 19/05/2015 00:00:00.000,19/05/2015 11:59:59.000

Now the Summary table should now show

18/05/2015 - 12 hrs
19/05/2015 - 6 hrs
20/05/2015 - 12 hrs
21/05/2015 - 12 hrs
22/05/2015 - 0 hrs
23/05/2015 - 16 hrs
24/05/2015 - 10 hrs

The 'Leave of Absence' on the 20th had no effect on the total for the day as it was between planned work times. how to do this within T-SQL, as simple as possible as I've got to had this code over to other staff members to maintain, who have not had much SQL experience yet?

I've tried doing it as a temp table, with dual insert/select commands, splitting the times over midnight, which partially worked but missed some of the combinations.

View 1 Replies View Related

Visual Studio 2008;SQL Server 2005;SQL Server Compact Edition 3.5 Question

Aug 26, 2007

I have a question about a problem that I cannot seem to tackle. I have installed the following programs on Windows Vista:

- SQL Server 2005
- Visual Studio 2008
- SQL Server Compact Edition 3.5
- SQL Server Compact Edition 3.5 Server Tools

I want to do the following:

1. I want to create a SQL Server Compact Edition 3.5 database in the SQL Server Management Studio
2. I want my SQL Express server in SQL Server 2005 to be a distributor and publisher

About 1. In SQL Server Management Studio I cannot choose SQL Server Compact Edition 3.5 .
ABout 2. I tried to setup my server to be a distrubutor by running a stored procedure with the following name: sp_adddistributor. I get the following error: This edition of SQL Server cannot act as a Publisher or Distributor for replication.

Does anyone have a solution to both problems.

View 1 Replies View Related

Sql Server Compact Edition Data Source Missing In Server Explorer

Apr 3, 2007

Trying to learn how to use Sql Server CE, Tutorial says to open server explorer, add connection, new connection, select data source as .net sql ce (words to that effect). On my visual studio, it ain't there and I can't figure out how to get it there. I have uninstall all of the Sql Ce stuff and reinstalled it. So I'm missing some key link. What are the magic incantations to get to first base?



Ed Warren

View 4 Replies View Related

SQL Server Compact Edition Server Tools Setup Error On Vista

Oct 21, 2007

SQL Server 2005 SP2 Replication


I am having problems installing the SQL Server Compact Server Tools on my
Vista laptop to allow me to connect my Mobile Device running SQL Server
Compact directly to my SQL Server 2005 database through IIS.


I have done this successfully with an XP machine so I'm not sure if it is
Vista problem or not.


I have installed SQL Server 2005 SP2. When I try to install the replication
server tools (Sqlce30setupen.msi), in "System Configuration Check" window I get a failure on "SQL Server requirement" that says: "You must first install the Replication Components for SQL Server 2000 SP 3a
or higher or the SQL Server 2005 Replication Components" and the client components are full instaled in my computer.



I need help for detect and correct the problem.


Sincereously,
Alonso Junior

View 4 Replies View Related

How Can I Access SQL Server Compact Edition With SQL Server Management Studio Express?

Jul 26, 2007

Hello,

I just installed SQL Server Compact Edition, since I am considering using it instead of SQL Server Express for a local database in my application. The documentation mentioned that I could use SQL Server Management Studio Express to connect to the Compact Edition and create and manipulate databases.

To try to connect, I run Management Studio and bring up the "Connect to Server" dialog. Unfortunately, the pull-down list of "Server name"s does not include the SQL Server Compact Edition server. I do not know how to type in the server name manually, so I cannot connect.

To install Compact Edition, I downloaded it and ran "SQLServerCE31-EN.msi". This installed, and I assume registered, a number of DLLs in "C:Program FilesMicrosoft SQL Server Compact Editionv3.1".

Is there perhaps an additional step that I left out to complete the installation?

Might I need an upgrade to some other components? My Management Studio Version is:

- Microsoft SQL Server Management Studio Express 9.00.2047.00

I would appreciate any help you can provide.

Thank you,

WTW

View 7 Replies View Related

SQL Server Management Studio Express Won't Open SQL Server Compact 3.5 Databases

May 7, 2008

Hi all

Which tool can I use for structure editing of SQL Server Compact 3.5 databases? I'm installed SQL Server Compact 3.5. I have SQL Server Management Studio Express which was installed with SQL Server 2005 Express. Unfortunately this SSMS can create and open only 3.1 databases.

View 5 Replies View Related

Does Sql Server Compact Edition 3.5 Support RDA Synchronization With Sql Server 2000 Database?

Jan 21, 2008

Does Sql Server Compact Edition 3.5 support RDA synchronization with Sql Server 2000 database?

View 4 Replies View Related

Which SQL Server 2005 Compact Edition Server Tools Installation Package Do I Use?

May 26, 2007

Hi,



I am using SQL Express 2005 server and sql compact edition for my PDA. For synchronization, which SQL Server 2005 Compact Edition Server Tools installation package do I use?



Is it Sqlce30setupen.msi or sql2kensp4.msi or sql2kensp3a.msi? I know for sql server 2005 its Sqlce30setupen.msi. Is it the same for the SQL Express 2005?



Thanks

View 4 Replies View Related

SQL Server Management Studio Express 2005 Can't See SQL Server Compact

Feb 13, 2007

Hi,

I am very new to SQL Compact. I am trying to create one database which can work on the desktop application and also on a pda application. I want to create the database but I am unable to start without Management Studio. Can you guide me to the right tools so that I can create database, view it and manage it use something like Management Studio Express.

Also one more question is if my database needs to be at both places on the desktop and on pda how can i synchronise them. PDA will take using c# application data from RFID scans and then i need to sync that database on the desktop so that reports and other info can be generated from the desktop c# application. How to do this?

Please can you guide me to any webcasts or labs so i can clarify my doubts about the design.

Regards

Trushar

View 5 Replies View Related

Error While Connecting To SQL Server Compact 3.5 Database With SQL Server Management

Mar 11, 2008

Hello,

i tried to connect to a SQL Server Compact Database (version 3.5) with SQL Server Management Studio Express (Version 9.00.3042.00).

But i get the follwing error message (sorry, it's a german message):

.....................................
Es kann keine Verbindung mit 'D:DocumentsVisual Studio 2008Projects\_ProduktivSuperkalibrator_PrototypenSuperkalibrator_PrototypenDatenbankDatabaseTest.sdf' hergestellt werden.

------------------------------
ZUSÄTZLICHE INFORMATIONEN:

Sie versuchen, auf eine ältere Version einer Datenbank von SQL Server Compact Edition zuzugreifen. Falls es sich um eine Datenbank von SQL Server CE 1.0 oder SQL Server CE 2.0 handelt, führen Sie 'upgrade.exe' aus. Falls es sich um eine Datenbank von SQL Server Compact Edition 3.0 oder höher handelt, führen Sie die Komprimierung und Reparatur aus. [ Db version = 3505053,Requested version = 3004180,File name = D:DocumentsVisual Studio 2008Projects\_ProduktivSuperkalibrator_PrototypenSuperkalibrator_PrototypenDatenbankDatabaseTest.sdf ] (SQL Server Compact Edition ADO.NET Data Provider)
.....................................

Is there a solution to manage Compact Databases in Version 3.5?

Thanks!
Stefan Wagner

View 4 Replies View Related

SQL Server Compact Edition Server/IIS7 && Vista Incompatibility

Mar 20, 2007

Hi,

We are currently having a problem with a client running Vista business for a mobile application that uses SQLCE RDA with the Web Synchronization on IIS7.

I have run through the Configure Web Synchronization Wizard and it doesn't create a virtual directory. I manually create the virtual dir and point it to the new folder the Configure Web Synchronization Wizard created.

Browsing to the url "http://localhost/sqlce/sqlcesa30.dll" gives a valid test string.

Here is the ?diag response...
SQL Server Mobile Server Agent Diagnostics
2007/03/20 15:39:49

General Information


Item
Value

Server Name
localhost

URL
/sqlce/sqlcesa30.dll

Authentication Type
Anonymous

Server Port
80

HTTPS
off

Server Software
Microsoft-IIS/7.0

Replication
Allowed

RDA
Allowed

Logging Level
3


Impersonation and Access Tests


Action
Status
ErrorCode

Impersonate User
SUCCESS
0x0

ReadWriteDeleteMessageFile
SUCCESS
0x0


SQL Server Mobile Modules Test


Module
Status
ErrorCode
Version

SQLCERP30.DLL
SUCCESS
0x0
3.0.5300.0

SQLCESA30.DLL
SUCCESS
0x0
3.0.5206.0


Reconciler Test


Reconciler
Status
ErrorCode

9.0 Database Reconciler
SUCCESS
0x0

8.0 Database Reconciler
SUCCESS
0x0


SQL Server Module Versions


Module
Version

sqloledb.dll
6.0.6000.16386

9.0 replrec.dll
2005.90.3042.0

9.0 replprov.dll
2005.90.3042.0

9.0 msgprox.dll
2005.90.3042.0

8.0 replrec.dll
2000.80.2039.0

8.0 replprov.dll
2000.80.2039.0

8.0 msgprox.dll
2000.80.2039.0
When a Windows Mobile or Pocket PC device tries to do a ServerExecute or Push or Pull it gets this error message with SQLOLEDB ...

HResult = -2147467259
Message = " [ 600 ]"
NativeError = 29022
numericErrorParameters = {600,0,0}
Source = "Microsoft SQL Server 2005 Mobile Edition"

Which roughly translates to from the header file ...

#define SSCE_M_INCORRECTPROVIDERVERSION 29022 // The version of the Microsoft OLE DB Provider for SQL Server is not correct. Install MDAC 2.8 or later. [,,,Version,,]

When a Windows Mobile or Pocket PC device tries to do a ServerExecute
or Push or Pull it gets this error message with SQLNCLI ...



HResult = -2147467259

Message = " [ 9 ]"

NativeError = 29022

numericErrorParameters = {9,0,0}

Source = "Microsoft SQL Server 2005 Mobile Edition"

A very similar error.

From this it seems that both SQLCE 2 and 3 seem to want MDAC 2.8+ drivers. The drivers installed with Vista for SQL Native client seem to be versioned 6.0.* and the required versioning would seem to need to be in line with MDAC 2.8.

Are there installable drivers to bump the versioning of SQLNCLI or SQLOLEDB upto MDAC 2.8+ levels?

Or is there an alternative that will make it possible to run SQLCE RDA apps with Vista as the SQLCE server (i.e. sqlcesa30.dll)?

Cheers,

Jonathan

View 5 Replies View Related

ASP.NET And SQL Server Compact Edition

Sep 25, 2007

I am writing an application that is designed for the desktop, or small group (3 or less) desktops.  The application is being deployed using the Cassini web server as a complete "embedded" solution.  I wanted to use SQL Server Compact because of its small footprint and because of the synchronization capabilities with SQLServer.  Also, it is very easy to deploy vs. SQL Server Express.  The idea behind this APP is that someone might use it locally and then decide to subscribe to the service and then connect the same application to  a web services application. 
 That being said, and with knowledge of Microsoft's stance on SQL Compact under ASP.NET, I have most everything working and it works great except for one thing.  When I add a SQLDataSource to the page and set the connection string to my file and the DataProvider to System.Data.SqlServerCe and then bind a data grid to the SQLDataSource, it runs fine on my development machine, but when I deploy to my clean test machine, I get an error when the page loads saying:
Unable to find the requested .Net Framework Data Provider.  It may not be installed.
I can create a dataset in code (in fact,in several other places I do) and it works fine.  It is just the SQLDataSource(s) that are throwing this error.  I have a copy of System.Data.SqlServerCe.dll in the bin folder and I have all of the compact DLL's in the bin folder as well.  I can't figure out what I need to do.  I also have a reference to the System.Data.SqlServerCe in the web.config file.
 Can anyone help?
 
 

View 3 Replies View Related

Sql Server Compact Edition3.5

Jan 2, 2008

Hi, 
We have just installed visual studio 2008 for a windows mobile application development. This application requires a database also. VS 2008 installs sql server 2005 express edition and the sql server compact edition 3.5. We installed sql server management studio but this is for the express edition only. Please let us know how to use a similar tool for compact edition, we could not find any suitable for the same.
 Regards

View 1 Replies View Related

Question About SQL Server Compact 3.5 ?

Jan 17, 2008

I want to develop an application for my company's user to use...I will use VS2005 C# for windows as development tools,
and then I will develop the pocket PC or smart Phone for same application.In the first,the database I want to use is
SQL Server 2005 Express Edition,but it's difficulity to deploy , because it's fat files ,so if I use SQL Server compact 3.5 ,means I just develop once and I can re-compile the code for user to use Pocket PC and mobile...etc...right?

View 4 Replies View Related

New SQL Server Compact Edition

Jan 9, 2007

Does the new SQL server Compact edition RC1 (release in Dec 2006) replace the Microsoft SQL Server 2005 Mobile Edition Device SDK?

OR is this an additional database for specific requirements.

Currently developing against MS SQL Server 2005 Mobile Edition Device SDK;; if I switch to the Compact edition; is there a migration wiarzrd or Upgrade wizard available?

-jawahar

View 1 Replies View Related

SQL Server Compact Database..

Jan 4, 2008

Hi,

I am new to SQL Mobile developement and trying to developing a small device appliction. My C# code is shown below. My code is executing correctly, but i am not able to see the inserted records in to my SQL Compact database. What i am doing here? Please help.

FYI, I have added the database in to my solution. My solution and database resides in E:\some directory, where as the my assembly code base represents the datasource as \ProgramFilesMobExpTrackerMobExpTracker.sdf.


SqlCeConnection connection

{

get

{

if (_connection == null)

{

_connection = new SqlCeConnection(ConnectionString);

_connection.Open();

}

return _connection;

}

}

string CurrentFolder

{

get {return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);

}

}

const string databaseLocalFileName = "Northwind.sdf";

string DatabasePathName

{

get { return Path.Combine(CurrentFolder, databaseLocalFileName); }

}

const string BaseConnectionString = "Data Source=";

string ConnectionString

{

get { return BaseConnectionString + DatabasePathName; }

}


const string sql =

"INSERT INTO mobexptracker(ExpenseDt,ExpenseDescr,ExpenseAmt) VALUES (@ExpenseDt,@ExpenseDescr,@ExpenseAmt)";

const string sql1 =

"SELECT COUNT(1) FROM mobexptracker";



private void btnSave_Click(object sender, EventArgs e)

{

bool savesucess = Save();

if (savesucess)

{

MessageBox.Show("Expense Saved Sucessfully!");

}

else

{

MessageBox.Show("Error!");

}

}


bool Save ()

{

bool success= false;

using (SqlCeCommand cmd = new SqlCeCommand(sql,connection))

{

cmd.Parameters.Add("@ExpenseDt", txtDate.Text);

cmd.Parameters.Add("@ExpenseDescr",txtExpDesc.Text);

cmd.Parameters.Add("@ExpenseAmt",txtExpAmount.Text );

int cnt = (int)cmd.ExecuteNonQuery(); // ExecuteScalar();

cmd.

success = cnt > 0;

}



return success;

}



View 7 Replies View Related

Problem With SQL Server Compact 3.5

Apr 7, 2008



I am working with Visual Studio Team System 2008. I click File, New Project, Smart Device Project. I select Windows Mobile 6 Standard SDK for the platform, and .Net Compact Framework Version 3.5 for the framework version. When I click OK, I get the following message:

---------------------------------------
The operation cannot complete. To fix this problem, first copy these instructions into a separate file and then perform these steps in the order shown:

1. Click OK on this dialog box and the "Package Load Failure" dialog box which will appear after it, and then exit Visual Studio.
2. Reinstall Microsoft SQL Server Compact 3.5.
3. From the command line, run devenv /resetskippkgs.
------------------------------------


I did all of that, but the message still keeps coming up. Can someone explain how I can create a new project without this message coming up? Thanks.

View 8 Replies View Related

Beginning With SQL Server Compact

Dec 12, 2006

Hi all,
I am just starting to look into this interesting piece of technology, but am a little confused on how this works. I apologize if this has been asked earlier. My question is with this specific SQL server distribution, what is being used as the front end (to create and view your database & tables)? I read that SQL Server Compact Edition RC1 will have runtime only - How will you then get an application to point to a database via SQL compact?

View 3 Replies View Related

Zero Out SQL Server Compact 3.5 Database

Feb 22, 2008



I have an application that uses a SQL Server Compact 3.5 database backend. Everytime the application starts I want to zero out my database, meaning remove all records and reseed all identities. This datatbase is then filled based on a directory structure. Once this DB is filled I then send the entire database to a Windows Mobile PPC device via 802.11g WIFI. Before sending the database I first create an MD5 checksum on both the server and client sides to see if the database actually needs to be transfered. If the checksums match I will not send it as the client already has the lastest copy.

My problem is that I can never count on the database identity values starting at the same number on any particular instance of the application so the checksums are usually different. To solve this problem I need to ensure that everytime I start my server application the database (and all identifiers) will always be the same, will always be as if I just creaed it. How do I do this?!?!?!? This seems like it would be a trivial operation as I can imagine its use in multiple situations. Anyone know how to zero out the database?

View 1 Replies View Related

Compact 3.5 And SQL Server 2005?

Feb 26, 2008

Hi Guys,

Been following a video from Jim Wilson on merge replication between sql server 2005 and compact 3.5. The problem I have is that in the video, the subscriber types say SQL Server Compact, but on my 2005 server it says SQL Server Mobile. I have installed all the parts of Compact 3.5, so how do I get 2005 to use Compact and not Mobile?

Many thanks,

Millicent.

View 5 Replies View Related

Windows CE 6.0 And SQL Server Compact

Oct 9, 2007

I work with a Development board with an armv4 processor for a Windows CE 6.0 application and tried to install there an SQL Server Compact. But it doesn't work. My information from Google and other sites is that the Compact edition of SQL server does not work on a Win CE 6.0 platform.

Does someone can give me to this subject further information€™s? Is there an alternative?

Stefan

View 10 Replies View Related

SQL Server Compact Server Agent Is Not Working In IIS6

Mar 28, 2008

SQL Server Compact Server Agent is not working in IIS6, when i put de link http://myserver/myweb/sqlcesa35.dll?diag i recive de message

Service UnavailableThe problem is in windows server 2003 IIS6

please a need help....

View 2 Replies View Related

SQL Server Compact Tool 3.5 On Windows Server 2008

Apr 21, 2008

Im trying to install the SQL Server Compact Tools in Windows Server 2008, but the installation program won´t let me continue since it says that I must install the IIS Backward Compatibility Tools. The problem is that I can´t find where I do that.

I know that Windows Server 2008 is not listed as a supported os for the server tools, but surely I must at least be able to install them?

View 9 Replies View Related

Copy Data From SQL Server Compact To SQL Server 2005

Oct 4, 2007

Is there a way to use SSIS to copy data from a SQLServer CE database to a SQL Server 2005 database?

I have a database that has only been used on a mobile device, but now I want to use it among several devices, so I want to copy the structure and data to a SQL Server 2005 database and expand it's scope.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved