Results 1 to 9 of 9

Thread: [RESOLVED] Save boolean value to MS Database

Threaded View

  1. #1

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Resolved [RESOLVED] Save boolean value to MS Database

    hi,
    i have problem when save boolean value to database.
    this my code :
    vb.net Code:
    1. if bAdd then
    2.      scmd.CommandText = "insert into products(prod_id,status) values(@prod_id,@status)"
    3. else
    4.      scmd.CommandText = "update products set status=@status where prod_id=@prod_id"
    5. end if
    6.  
    7. scmd.Parameters.Add(New OleDbParameter("@status", CBool(chkStatus.Checked)))
    8.  
    9. scmd.Connection = dbConn
    10. Dim iResult As Integer = scmd.ExecuteNonQuery
    i get problem when execute query at line
    Code:
    scmd.ExecuteNonQuery
    Code:
    Data type mismatch in criteria expression
    Last edited by Tengkorak; Apr 1st, 2011 at 11:33 PM.

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