Results 1 to 5 of 5

Thread: [RESOLVED] How to select like on a parametized sqlcecommand?

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2011
    Posts
    268

    Resolved [RESOLVED] How to select like on a parametized sqlcecommand?

    Hello guys, im been doing great with parameters thanks to some people on this forum suggestions but now it semms that i am finally stuck with an issue, i have into a database a table which countains a column which is datebased, the date is date and time.
    Now i am trying to search based on the day only, so it will filter all rows with the date from the date & time column, example:
    Code:
    id|    datestarted  |summary             |isdeleted|
    1 |18-10-2001 17:30|it started out great...|0          |
    2 |21-11-2011 17:30|had some issues...    |0          |
    now i tried:
    Code:
    maskedtextbox1.text="18-10-2011";
    sqlcecommand.commandtext = "SELECT * FROM TABLE1 WHERE IsDeleted=0 AND datestarted LIKE @datestarted";
    sqlcecommand.parameters.addwithvalues("@datestarted",maskedtextbox1.text +"%");
    however this doesnt work by not returning any error at all and never finding any match, how can i fix this? ive searched around the net and all i could find was non parametized commands, any help regarding this matter will be appreciated as usual, thanks for your time taken to read this thread and thanks in advance for any reply
    Last edited by Legendary_Agent; Mar 7th, 2012 at 11:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width