Results 1 to 7 of 7

Thread: [2008] using VB variables in SQL statements

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    Resolved [2008] using VB variables in SQL statements

    I want to use VB variables in SQL code...
    Dim varCount As Integer = 3
    Dim sqlCmd As New SqlCommand("SELECT test FROM MyTable WHERE id = {varCount}")

    The sql syntax may be wrong, because I typed this by hand, but I want to know how I can use varCount in my SQL statement...

    Can anyone help me?

    Thanks
    Last edited by Icyculyr; Feb 3rd, 2008 at 03:54 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