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.


Delete from SQLlite


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-24-2008, 04:48 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 278
Default Delete from SQLlite

Hi

Can somebody please tell me what is wrong with the following coding

'erase a job
i=Msgbox ("Are You Sure To Erase The Selected Job? ","Erase Job",cMsgBoxYesNo,cMsgBoxQuestion)
If i=6 Then
text="Delete From Jobs Where JobName = " & quote & ListJobs.Text & quote
'Msgbox (text)
cmd.CommandText=text
cmd.ExecuteNonQuery
con.Close
End If

I am trying to delete a jobname from the SQLLite database.

Thanks
Michael
Reply With Quote
  #2 (permalink)  
Old 08-24-2008, 06:01 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 4,831
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

What error do you get?
Some tips:
'If i = cYes Then' is more clear than 'If i = 6 Then'.
It is better to use a parameterized query:
Code:
cmd.AddParamter("Value1")
cmd.CommandText = "Delete From Jobs Where JobName = @value1"
cmd.SetParameter("Value1",ListJobs.Text)
cmd.ExecuteNonQuery
Reply With Quote
  #3 (permalink)  
Old 08-24-2008, 07:29 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 278
Default

Hi Erel

Thanks for your help

Thanks
Michael
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
read and delete sms...how? Byak@ Questions & Help Needed 1 10-12-2008 06:42 PM
Me And SQLLite Again ceaser Questions & Help Needed 3 08-12-2008 04:36 AM
Delete a row in a table and simultaneously delete it in the database gonzamax Questions & Help Needed 2 12-25-2007 01:23 PM
Delete keypress emaster Questions & Help Needed 2 12-04-2007 06:15 AM
Delete Control and Delete Form Items alfcen Basic4ppc Wishlist 3 10-05-2007 12:09 PM


All times are GMT. The time now is 11:58 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0