Funny Problem (bug?) Using MAX() On SQL Mobile
Feb 8, 2006
This sure looks like a bug, but I'm still new...
First I create a simple database:
SqlCeEngine eng = new SqlCeEngine(@"Data Source=My Documents est.sdf");
eng.CreateDatabase();
eng.Dispose();
Then I put something in it:
SqlCeConnection conn = new SqlCeConnection(@"Data Source=My Documents est.sdf");
SqlCeCommand cmd = new SqlCeCommand("CREATE TABLE myTable (ID int, name nchar(10))");
cmd.Connection=conn;
conn.Open();
cmd.ExecuteNonQuery();
cmd.CommandText="INSERT INTO myTable (ID, name) VALUES (1,'bill')";
cmd.ExecuteNonQuery();
Then I try to get the maximum value from the first column.
cmd.CommandText = "SELECT max(ID) FROM myTable";
int index = (int)cmd.ExecuteScalar();
At this point I get an InvalidCastException raised. Using the datareader to extract the value produces the same exception, however I can go through the Query Analyzer on the device and execute the query and it comes out fine...???
This has really got me confused. Any thoughts?
View 8 Replies
ADVERTISEMENT
Aug 16, 2004
Ok a network tech put an executive assistants database on sql with the upsize wizard in access. Only problem is that she cant input anything into the database, my guess is that its due to no Primary key in the new sql table. I have had this problem before am I correct in my assumptions???
View 6 Replies
View Related
Oct 28, 2004
I have two fields I am searching on .... address and zipCode
When I have both pieces of data, everything is fine, i get back the expected results, but i am unable able to search on the individual pieces. Here is the SQL I am using. It's placed within a store procedure in Sqlserver that I amreferencing from my VB.net code.... any help??
IF ((NOT @address IS NULL) AND( NOT @zipCode IS NULL))
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @address AND ShpAddr_ZipCode = @zipCode
END
ELSE IF NOT @address IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @address
END
ELSE IF NOT @zipCode IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_ZipCode = @zipCode
END
any help would be great. thanks
View 3 Replies
View Related
Jul 20, 2005
Hi,In order to establish a security enhanced SQL server setup, I triedto switch off network access by disabling all networking protocols,so that the server can only be reached through a pipe. Neverthelessthe server was visible in the network and could be accessed fromall clients. Does anybody know what is going on here?Georg
View 1 Replies
View Related
Sep 22, 2006
I specified configuration like shown below
"select * from table where id<>***" always doesn't work
however i changed that like
"id != ***" working!
Who can tell me why?
View 3 Replies
View Related
Jan 26, 2007
Can any one please help explain why this error has happened, it is not a normal error of SSIS,
"SSIS Debug host has encountered a problem and needs to close. We are sorry for the inconvenience"
It has 2 buttons Debug and Close, this error happened in the middle of a script task.
View 1 Replies
View Related
Apr 18, 2006
I run a query in QA which return funny characters (suppose to be chinese characters). I try saved as CSV and open in excel, still it remain as those funny characters... What can I do to get those output into the chinese character. It doesn't need to be in QA... but I need it in Excel.
Thanks
View 2 Replies
View Related
Jan 17, 2003
How do l filter out funny characters in a field like (',','@','#','"'.'/')etc And Repeating digits Like 5555555,2222,111111,00,
000000000.
Tried using the patindex but my method is too long.How do l do that ?
View 3 Replies
View Related
Mar 1, 2006
i query a purchase order table, there is one column called PO_No, format: LP-0245111-0004
i make following statement to query: the middle code act as my id, using it search my records, the last 4 digit used to find the last purchase order number
SqlSelectCommand2.CommandText = "SELECT PO_No FROM [PURCHASE ORDER] WHERE PO_No Like '%" & GetYearCode() & "%' ORDER BY Right(PO_No, 4) DESC"
i checked my database, last record is LP-0545381-0300
in my debuging process, surprisingly found that selected record is LP-0545381-301 !
any one hav any suggestion? ^_^
View 2 Replies
View Related
Apr 3, 2006
I am getting a new server online at a customer, and our system shows very funny erorrs under full load. No explanations could be found. Anyone has some?
Here we go:
Server failed to resume the transaction, desc: 360000054a. The transaction active in this session has been committed or aborted by another session.,
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
and
New request is not allowed to start because it should come with valid transaction descriptor.
System.Data.SqlClient.SqlException
I am a little lost on those. Simple fact is that I do not find any description of those. Anyone an idea what causes these?
View 2 Replies
View Related
Aug 8, 2006
Dear ppl,
I am writing an application for a device (MDA Pro T-Mobile) having Windows Mobile 5.0 using
-MS .NET Compact Framework 2.0 SP-1
-SQL Mobile 2005.
-VS 2005 .NET
The application uses Merge Replication. The error occurs in the Synchronise() Method of the SqlCeReplication object.
"SQL Server Mobile encountered problems when opening the database."
repl.AddSubscription(AddOption.CreateDatabase);
repl.Synchronize();
I don't understand why I am having this error. It does create the database on AddSubscription() method but it is failing opening the database on Synchronise(). I have also tried uninstalling and then reinstalling all the SQL Mobile components in the following order.
-sqlce30.wce5.armv4i.cab
-sqlce30.repl.wce5.armv4i.cab
-sqlce30.dev.ENU.wce5.armv4i.cab
However, when i run this application on a device(Dell X50 AXIM) with Pocket PC 2003, it runs fine creating the database and sysnchronising it.
The target platform for the project is Windows Mobile 5.0 Pocket PC SDK.
Does any one have any clue what could be the problem ?
Regards
Nabeel
View 6 Replies
View Related
Jun 15, 2006
I am migrating a pocket PC application from VS 2003 to VS 2005 and a few weeks ago I hit the following problem when replicating
A SQL Mobile DLL could not be loaded. Reinstall SQL Mobile. [ DLL Name=sqlceca30.dll]
Scanning forums for help I saw that other people had had this problem and one
http://www.eggheadcafe.com/aspnet_answers/NETFrameworkCompactFramework/Feb2006/post25814466.asp
suggested that this problem could be circumvented by getting the replication object early and then continuously using the same object for subsequent replications.
I did this and it works a lot better now but ever so often I get another error which is
Native Error 28559 SQL Mobile encountered problems when opening the database
My only option at this point is to stop and start the application which cures the problem.
View 4 Replies
View Related
Mar 23, 2006
Hello,
I am developping a non-managed C++ application for PocketPC using a SQL Server mobile database.
The application is compiled for PocketPC 2003 and uses SQL Server Mobile v2. I use Visual Studio 2005. But I need to compile the application for Windows Mobile 5.0 devices. So I installed the WM5 SDK and had the WM5 into my project configuration.
The "ssceoledb.h" which I include incluses the "transact.h" file. But my problem is that this file is only provided with the PocketPC 2003 SDK and not in the WM5 SDK.
So I cannot use the WM5 configuration project with SQL Server. I also tried with the last SQL Server Mobile 2005 (ie v3.0) and the "ssceoledb30.h" also includes "transact.h".
Did I miss something to install ?
Do you know how I can resolve the problem ?
By advance, thank you for any answer.
--
Gregoire
View 9 Replies
View Related
May 18, 2006
Using MS VS 2005 (incl SQL Server Mobile)
MS Pocket PC 2005 SDK
I am working on a project that builds for Pocket PC on both Mobile 2003 and Mobile 5. The project uses/will use SQL Server Mobile to store local data.
Project created from new with support for both platforms. I include required header files ssceerr30.h and ssceoledb30.h.
Project builds fine in WM2003 configuration, release and debug.
When I build for WM5 the compiler cannot find the header file transact.h. This is included from within ssceoledb30.h. Same as under WM2003.
In WM2003 configuration if I highlight the ssceoledb30.h include in Visual Studio and open the header, it takes me to <Visual Studio dir>SmartDevicesSDKSQL ServerMobilev3.0. I then locate the include for transact.h and do the same, which takes me <Visual Studio dir>SDKPocketPC2003include. The file exists.
If I repeat the above 'browsing' under the WM5 configuration, ssceoledb30.h takes me to a different copy in the WM5 SDK directory. There is no diff between the file here and the other copy used by WM2003. If I attempt to open transact.h - file does not exist.
Fix (which I'm not too sure about, i.e. is it OK?) - If I copy transact.h to the WM5 SDK directory, the project builds.
Why has transact.h disappeared from WM5 SDK?
I can find no ref's to this problem anywhere. Is my installation of the WM5 SDK corrupt? What else could I be missing?
Is there a sample for SQL Server mobile (like the NorthwindOLEDB sample) that comes configured to build for WM5?
View 1 Replies
View Related
Mar 6, 2006
It is possible to access a Sql Server 2005 Mobile database in a VS2003 application (compact framework) ?
Thanks
Robson
View 4 Replies
View Related
Sep 8, 2007
I receive error 25123 on my PPC (audiovox 6600) in a reproducable way (usually) with .net 2.0 application that is using SQL CE that I wrote:
Open the application
Connect to the database
Close the applicaton
Re-Open the application
Connect to the database <-- Error occurs
I will also receive the error if my application isn't the first application launched (or very close to the first to launch).
I don't believe it's a memory issue as according to the memory manager I have plenty of memory:
At boot up only start screen items loaded: 18.46 Used 49.89 Free
Launch Resco File Explorer to click EXE: 19.18 Used 49.18 Free
Launch my application (no DB connection): 23.64 Used 44.71 Free
Connect to the DB and do select count(*) from a table with 0 rows: 26.27 Used 42.08 Free
Close the application (this.Close() on the form: 19.38 Used 48.97 Free
Relaunch App and connect to DB receive error: around 38 Used around 30 free
I was unable to reproduce the issue right now while typing this message, the last sets of numbers are from memory, and include other applications that are currently running.
The only way I have to get SQL CE to load again is to soft reset the PPC. If the application is able to connect to SQL CE at least once it is fine up till I close it and re-open the application. So it either connects and runs great, or it can't connect at all.
Any help in resolving this issue would be greatly appreciated.
Wayne
View 1 Replies
View Related
Apr 24, 2006
Hi folks, I'm new to Windows Mobile progamming, and new to this forum. Apologies in advance if I'm asking a boneheaded question, but I've done searches and can't find anything directly applicable to my problem.
I'm currently walking through the published MS tutorial in setting up an SQL Server 2005 Mobile application that subscribes to a publication on SQL Server 2005 to exchange information.
I've gotten almost all the way through... successfully set up the server components, creating the publication, etc. On the mobile side, I've been able run the cab files to install the SQL Mobile components and to create the project, add the reference to the dll, and instantiate an engine object. It compiles.
The step in the tutorial after that, though, where you specify the data source from the "data" menu, I've got a problem. When I try to use the "new connection" dialog from choosing the data connection, "MS SQL Server Mobile Edition" doesn't show up as a choice. I've tried choosing any of the other combinations, and in teh subsequent "Connection properties" section my database, SQLMobile (as in their sample) is available, but I get an error when I choose it and click OK. Clicking on "Test Connection" gives me a connection successful message.
My guess is that something about the Mobile server side components is not installed correctly on my development machine, but honestly I have no idea how to begin to fix it. Has anyone seen this problem before and know how to resolve it?
Your time and any knowledge sharing is greatly appreciated.
Thank you,
-Dana
View 8 Replies
View Related
Jul 21, 2006
This is a great tutorial and it's a shame one of the more important steps was missed.
In the €œCreate the snapshot user€? section you you find the steps to create the snapshot_agent account. Then in the €œCreate the snapshot folder€? section you find the share and folder permissions. However, at no point do the instructions advise you about adding the snapshot_agent to the SQL Server Logins. The result is that agent cannot perform the initial snapshot but you won't find this out until 50 steps later after Step 10 in the section €œCreate a new subscription".
To get back on track, openthe Object Explorer's Security section and add the snapshot_agent to your logins. Then using the "User Mappings", set an appropriate level for the SQLMobile database role. Once completed you then need to run the agent.
Right-click the SQLMobile publication you created and select "View Snapshot Agent status". From that dialog you can select "Start" to run the agent. When it completes, you can return to the tutorial section "Create a new subscription" and continue with the tutorial.
View 4 Replies
View Related
Nov 3, 2007
I am studying the tutorial in SQL Server 2005 Mobile Edition Books Online, and the topic is Creating a Mobile Application with SQL Server Mobile. I have got a problem when creating a new subscription after created a new SQL Server Mobile database. And the problem is shown below:
New Subscription Wizard
- Beginning Synchronization (Success)
- Synchronizing Data (100%) (Error)
Messages
* Failure to connect to SQL Server with provided connection information. SQL Server does not exist, access is denied because the IIS user is not a valid user on the SQL Server, or the password is incorrect.
HRESULT 0x80004005 (29061)
* 無法完æˆ?作æ¥ã€‚
- Finalizing Synchronization (Stopped)
- Saving Subscription Properties (Stopped)
Before I have met this problem, I have finished all the task. And I can browse the localhost web site by using anonymous account even I use internet explorer or browse the directly in IIS.
Does anyone can solve it?? Thank you very much~~~
View 3 Replies
View Related
Jan 30, 2008
Hi, when I copy and paste results from query analyzer into Excel it appears that values with zeroes at the end loose the zeroes. Example, if I copy and paste V128.0 into an Excel cell it comes out as V128 or if I copy 178.70 it displays as 178.7 - any ideas? I'm using SQL Enterprise Manager for 2000.
View 6 Replies
View Related
Sep 16, 2007
Hi:
When I try and connecto to SQL CE I always get an invalid operation exception. I"m afraid that I did not follow the proper install for Orcas Beta 2. I can't remember if I was supposed to uninstall SQL Mobile 2005 first or not.
All I know is when I try and use my SQL CE I can't connecto to a DB / sdf file ?
Any help would be appreciated I"m just starting to use SQL CE.
thanks
mark
View 2 Replies
View Related
Apr 12, 2006
Hi,
There are many text records need to be storeaged in my application.
I am new guy to Sql Mobile.
If I choose sql mobile to save my data. Will my app be more complex to deploy ?
Before I use Sql Mobile on device(wm5), need I install it first?
any other advice??
Best regards
PWang
View 1 Replies
View Related
Apr 11, 2006
Dear MSDN Support,
It is pleasurable being in contact with you and getting the desired support, for that i am feeling free inquiring about some aspects related to my graduation project.
Well here i am facing a problem with my database. I had created a full Pocket Pc project i added references, datasources and data connection for the SQL Mobile Database i am using. While i do an query like insert,update, delete, select it works on the pocket pc emulator and i check with the emulator query analyzer. What i am asking about that i am not able to see those updates in the mobile database in the sql server 2005 mobile edition, everything is done only in the emulator but after i exit the application and check my mobile server the database is still empty !!
I appreciate your hard working, and i do believe that there is someone here who is going to provide me with the support i need.
I am looking forward to getting your reply soonly.
Thank you for your attention.
Kindly Regards;
View 1 Replies
View Related
Apr 1, 2008
Hi,
I'm trying to install SQL Server 2005 Mobile on a Trimble GeoExplorer (GeoXT). It is running Microsoft Pocket PC v4.20. I've installed on a WM5 device without any problems, but can't seem to get it to work with this device. Regardless of what CAB I use, it says "Unsupported System Version" and will not install. I've tried using both:
sqlce30.wce5.armv4i.CAB
sqlce30.ppc.wce5.armv4i.CAB
, without any success. Any ideas??
View 6 Replies
View Related
Jan 22, 2008
I am geeting following error while trying to acquire db connection. I use sql server ce2.0 with vs2005
Failed to find or load the registered .Net Framework Data Provider
View 3 Replies
View Related
Apr 6, 2007
Hi,
I have created an SQL Server Mobile Database, is it possible to ODBC to it by creating a new data source, under admin tools in Windows XP?
Cheers
View 4 Replies
View Related
Apr 28, 2008
Hi
How to setup mobile notifications on jobs using SQL Server 2000. Aim is when a job fails I should receive SMS notification on my mobile phone.
Please show me web sites on this topic.
Please help.
Thanks & Regards
Raj.
View 1 Replies
View Related
Sep 22, 2006
Hi. I'd like to try a hand at SQL 2005 Mobile.
I've installed sqlce30.ppc.wce5.armv4i.CAB on an HP iPaq 1950 Pocket PC, provided by the Microsoft SQL Server 2005 Mobile Edition Device SDK, http://www.microsoft.com/downloads/details.aspx?FamilyId=5BD8ABAA-5813-4DB3-B23A-24551DE2ECC1&displaylang=en
When I tried to interact with it, I got an error message that the .NET Compact Framework 2.0 was missing on the pocket PC.
So I installed the .NET CF v2.0 SP1 found at http://www.microsoft.com/downloads/details.aspx?familyid=0c1b0a88-59e2-4eba-a70e-4cd851c5fcc4&displaylang=en and it updated both the local machine and the Pocket PC.
However, now when I use my local SSMS to talk to the SQL Server Mobile Engine, I keep getting the error:
Microsoft SQL Server 2005 Mobile Edition and/or .NET Compact Framework v2.0 is not properly installed on your mobile device or the device is not responding. (SQL Server Mobile Edition ADO.NET Data Provider)
(Now I know I can communicate with the Pocket PC because I browse out to it first)
Am I missing something more fundamental, or does this not work with a non-RTM framework?
View 1 Replies
View Related
Aug 8, 2006
An update was supposed to be released for SQL Server Mobile which enabled support for CE 4.2. This was supposed to be released around the time of CF 2.0 sp1. SP1 came out over a month ago and there is still no sign of the SQL Mobile update. Does anyone have any information on a release date ?
View 6 Replies
View Related
Aug 11, 2006
I have the following setup
Server 1: Windows 2003 inc IIS. Also on this server is SQL Server Web sync web service and it has an external IP address for internet connectivity
Server 2: Windows 2003 inc SQL Server 2005. This server has a database setup with replication so the a Window Mobile 5 device can do a merge replication.
My problem is that the replication fails when trying to send the snap shot from Server 2 to the mobile device. The device seems to get through to the replication agent, as entries in the Replication monitor are logged (see below).
I have checked all the permissions on the relevant shares required for replication (basically set "Everyone" with full access).
My initial question would be.... When the snapshot is been sent to the mobile device, does the SQL Server try to send it directly to the internet or does it go through "SQL Server Mobile Server Agent 3.0".
Please can someone help, as this is causing me some REAL problems.
Error messages:
The schema script '\ukrt1-sql902SQLRepluncUKRT1-SQL902_EXEL_DAMAGECODESEXEL20060810142533DamageAction_2.sch'
could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147023570)
Get help: http://help/MSSQL_REPL-2147023570
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization,
the merge process may have been unable to create or write to the message file. When troubleshooting,
restart the synchronization with verbose history logging and specify an output file to which to write.
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
View 1 Replies
View Related
May 10, 2006
Hi,
I would like to know if we can install both versions of mobile SQL (SQL CE 2.0 and SQL Mobile 2005) on the same PDA. I know that two versions of CF .Net can be installed.
Indeed, I have an old CF .Net 1.3 application connecting to a SQL CE 2.0 database and a new one using CF 2.0 and SQL Mobile 2005. The first one will be migrated but in the future ... Meanwhile, the customer wants to run the two applications without any code modification.
Is it technically possible ? Is it recomended ?
Thanks in advance for your answers.
View 1 Replies
View Related
Mar 8, 2006
Dear All,
I need to make Sql Server Mobile replication with Sql Server 2005, could any body tell where can I find step by step procedure to make this?
Thanks and Regards
View 5 Replies
View Related