Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


About SQL Database


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2008, 04:54 AM
gjoisa's Avatar
Knows the basics
 
Join Date: Feb 2008
Location: Udupi , India
Posts: 53
Default About SQL Database

Hi
I have created a database called "Atlas.sl3" with SQL . My question is, how to get the first field of a record with key ? My intention is to get the first fields of all records in a list , when i type 1 or 2 letters in a textbox and clicking a button . eg: when i type 'A' ,all first fields of records (Agra , Ajmer , Ahmedabad) starting with "A" should be added to a listbox . how to write the coding ?
Reply With Quote
  #2 (permalink)  
Old 02-17-2008, 05:20 AM
willisgt's Avatar
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 157
Default

On each key press (I presume the user is typing into a text box), create and execute a new sql query, like such:

"SELECT field1,field2,field3 FROM (your_table_name) WHERE field1 LIKE '" & textbox1.text & "%' "

Be warned, this method can be slow, especially if you've got a lot of data. You might consider reading the contents of the database into a table, and extracting only the records matching your search - especially if the data won't be modified by the user.

Gary
__________________
PC: Windows XP Pro SP3 / Basic4PPC v6.5
PPC: HTC 8925 (AT&T Tilt) / Windows Mobile 6

Last edited by willisgt : 02-17-2008 at 05:38 AM.
Reply With Quote
  #3 (permalink)  
Old 02-17-2008, 11:08 AM
gjoisa's Avatar
Knows the basics
 
Join Date: Feb 2008
Location: Udupi , India
Posts: 53
Default

thank you for your suggession . now i have problem in compiling after setting database actions .there comes one error message about SQL . pls help me .

Last edited by gjoisa : 02-17-2008 at 11:15 AM.
Reply With Quote
  #4 (permalink)  
Old 02-17-2008, 12:35 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Can you describe the error message or take a screen shot of it?
Reply With Quote
  #5 (permalink)  
Old 02-17-2008, 03:37 PM
gjoisa's Avatar
Knows the basics
 
Join Date: Feb 2008
Location: Udupi , India
Posts: 53
Default

the error message reads so ;"Error Compiling Program . Error message : Error CS0012 : The type 'System.Data.Common.DBConnection' is defined in an assembly 'System.Data,Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089'.L ine Number=25 . Line:Com.New1("""",con.Value)" .

I have added System.data.SQLite.dll in both desktop and device(seperately as required) in components . I used here 'com' for command . I think this much can help you to understand my problem .
Reply With Quote
  #6 (permalink)  
Old 02-17-2008, 03:40 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You shouldn't add System.data.SQLite.dll in the components dialog.
Reply With Quote
  #7 (permalink)  
Old 02-17-2008, 03:44 PM
gjoisa's Avatar
Knows the basics
 
Join Date: Feb 2008
Location: Udupi , India
Posts: 53
Default

then which sql dll files to be added ?
Reply With Quote
  #8 (permalink)  
Old 02-17-2008, 04:18 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You should add SQLDesktop to the desktop and SQLDevice to the device.
Later when you distribute your application you should include System.Data.SQLite.dll (from Libraries\SQLNative folder).
Reply With Quote
  #9 (permalink)  
Old 02-17-2008, 04:32 PM
gjoisa's Avatar
Knows the basics
 
Join Date: Feb 2008
Location: Udupi , India
Posts: 53
Default

i have added the dll files as directed by you . After when tried to compile there is another error message :Error CS00234: The type or namespacename 'SQLite' does not exist in the namespace 'System.data" .(Are you missisng an assembly reference?) .what does it mean ? what to do ?
Reply With Quote
  #10 (permalink)  
Old 02-17-2008, 04:44 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You are probably not using the updated SQLDesktop / SQLDevice.
Please download the attached files and copy them to your source code folder.
SQLDesktop and SQLDevice date should be 11/25/2007.
Attached Files
File Type: zip SQLDesktop.zip (9.0 KB, 26 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Record from one database to another database. mozaharul Questions & Help Needed 0 07-15-2008 05:47 AM
2 sql database gjoisa Questions & Help Needed 1 07-01-2008 11:06 AM
about sql database gjoisa Questions & Help Needed 5 05-16-2008 11:40 AM
UTF-8 Database EdQas Questions & Help Needed 5 10-16-2007 06:11 PM
How to convert an Access database to a sqlite database Peter Code Samples & Tips 5 07-24-2007 04:20 PM


All times are GMT. The time now is 03:15 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0