| Tutorial covers SQL database for Windows Mobile |
Nov. 25, 2008
Installing a SQL database on a Windows Mobile phone takes a little fussing, but the benefits are well worth it, says an eWeek story. In "Creating Windows Mobile Databases with SQL Anywhere," Jeff Cogswell does just that, using Visual Studio to harness the power of the Sybase/iAnywhere data management suite.
Developed by Sybase subsidiary iAnywhere, SQL Anywhere version 11 may not be the only database that runs on Windows Mobile, but according to senior editor Cogswell, the Windows Mobile version is particularly impressive. It is especially useful, he adds, in solving problems he has run into working with data storage in mobile device development.
"What's cool about the Windows Mobile edition is it allows developers to have full relational database access through SQL right on a mobile device running Windows Mobile," writes Cogswell. "Users can store the tables right on the device, and later synchronize them with a server."
 HTC 8525 (Click for details) |
Cogswell proceeds to install a "Developer" version of SQL Anywhere on a Windows Mobile 6-equipped HTC/AT&T 8525 phone (pictured). The first step is to install the full Windows desktop version on a desktop PC. The Windows Mobile edition can then be extracted from the desktop version and installed on the phone, he writes. The desktop version offers development tools that include a .NET assembly that runs on Windows Mobile, and which can be used to develop C# apps within the Visual Studio environment, he adds. In addition to the Windows Mobile and desktop versions, there is also an "Ultralite" edition that runs on Windows CE devices.
Are we there yet?
Cogswell immediately runs into trouble due to SQL Anywhere not easily recognizing Visual Studio 2008, which the writer already had installed. He also had trouble finding the SQL Anywhere documentation, samples, and information on how to transfer SQL Anywhere onto the Windows Mobile device.
After explaining how to jump through these annoying "hoops," Cogswell proceeds with the installation, which "went perfectly fine." Next, he starts developing SQL Anywhere applications, using Visual Studio and a provided sample application. He details the classes available with the iAnywhere.Data.SQLAnywhere namespace, which he says are analogous to typical Visual Studio classes.
After compiling the project, he finds no errors. The writer then copies the executable to the storage card on the Windows Mobile phone, runs the executable, and finds that everything works. In short, writes Cogswell, "There should be very little learning curve for developing for SQL Anywhere on a Windows Mobile device."
Looking for trouble
In fact, Cogswell starts to kick around, seeming to look for trouble. In the process of showing how to adjust user names and passwords in SQL Anywhere, for example, he encounters an exception that crashes the program. After adding an exception handler in Visual Studio, though, all is well. He also performs queries against the sample database, solves some column-naming issues, works with stored procedures, and generally kicks the SQL tires.
"Looks like this thing really works," Cogswell concludes. "And it's surprisingly fast. In other words, I have here a full-featured SQL database right on my mobile phone."
His next project will be to develop an application that handles "advanced replication" between the device and desktop servers, as well as establishing connections with other machines. These projects will be featured in a future story on DevSource.com.
Further information
The eWeek story. "Creating Windows Mobile Databases with SQL Anywhere," by Jeff Cogswell, should be available here. More information on SQL Anywhere should be here.
Related Stories:
(Click here for further information)
|
|
|
|