Last post Jun 25, 2019 01:47 AM by Fei Han - MSFT
Jun 24, 2019 03:25 PM|jsshivalik|LINK
Is the below Statement correct
using (SqlCommand cmd = new SqlCommand("SELECT Count(*) FROM [Test] Where [Invoice No]=@InvoiceNo and [Location] = @Store and [Status] in ('','Pending')", con))
Jun 24, 2019 03:32 PM|PatriceSc|LINK
Yes it is syntactically correct. If you have a problem when running this statement it would be easier to directly discuss the problem you have (which error message and on which line).
Jun 25, 2019 01:47 AM|Fei Han - MSFT|LINK
Your query accept parameters in the WHERE clause, to execute the SqlCommand you defined as expected, you need to add and supply parameters.