Problem with querying sql server from vb

前端 未结 3 1920
花落未央
花落未央 2021-01-27 22:31

Whenever I have

Dim catID as integer

And I use this in a query like this:

cmd.CommandText = \"select * from categories where p         


        
3条回答
  •  广开言路
    2021-01-27 22:50

    Just remove single quotes:

    cmd.CommandText = "select * from categories where parentid=" + catID.ToString()
    

提交回复
热议问题