Hi. I'm using Vs2008 and I need to be able to change the Select command in my DataSource according to what the user enters. If the user doesn't enter a customer ID then I want to be able to change the select to all customer ID's. I don't know how to fill the gridview with the customized select, so this is the next best thing. I have tried the following code, but it doesn't work.
strSql = "Select * from Tkhist1 where LocationID = '" & inTxtLocID.Text & _
"' and (TicketDate >= '" & strFromDate & "' and TicketDate <= '" & strToDate & "');"
SqlDataSource1.SelectCommand = strsql
I am at a stand still and would appreciate any help you can give me and don't tell me to google it - I have.
Thanks
Cathy
strSql = "Select * from Tkhist1 where LocationID = '" & inTxtLocID.Text & _
"' and (TicketDate >= '" & strFromDate & "' and TicketDate <= '" & strToDate & "');"
SqlDataSource1.SelectCommand = strsql
I am at a stand still and would appreciate any help you can give me and don't tell me to google it - I have.
Thanks
Cathy