i am using visual stdio 2008 and sql server 2005
dim selectquery = "SELECT Purchase_master.Customer_name, Purchase_details.Item_code, Item_Master.Name,
Purchase_details.Quantity, Purchase_details.Cost, Purchase_master.Date
FROM Item_Master INNER JOIN (Purchase_master INNER JOIN Purchase_details ON
Purchase_master.Bill_id = Purchase_details.Bill_id) ON Item_Master.Item_code = Purchase_details.Item_code
WHERE Purchase_master.Date= " + cboPDate.SelectedValue.ToString()
when this selectquery executed it gives me
error
“ERROR near syntax 12”
my cboPDate is a combobox binded with my database which return’s data and time in
“2/18/2011 12:00:00 AM”
please help me out
I suspect it is treating it as a delimiter.It would be better to change it to
And then add the date as a parameter, this would prevent SQL injection attacks and also promote plan caching