This is a migrated thread and some comments may be shown as answers.

Conditional SQL datasource query did not work

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bernard
Top achievements
Rank 2
Bernard asked on 19 Nov 2012, 04:04 AM
Hi all,

I've been using the RadControls (particularly RadGrid) for about a month now and i just found a weird bug with my RadGrid app when I tried to add additional condition to the sqldatasource query string. 

in my scenario, i have a list of employees and I'd like to exempt the Resigned employees from the active duty list by using the following query:
[code]
<asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings: grabber %>"
        SelectCommand="SELECT [DriversID], [Name], [DOB], [POB], [IDNumber], [LicenseNumber], [Address1], [Address2], [Mobile],
                              [Phone], [Country]
                       FROM [Drivers] WHERE DriversID = @DriversID AND Resigned is NULL"
        runat="server">
[/code] theoretically this should work however I'm quite surprised to find that the RadGrid still displays those Resigned employees. I've tried numerous query combinations to no avail. I hope someone could shed a little light into this. thanks in advance

1 Answer, 1 is accepted

Sort by
0
Bernard
Top achievements
Rank 2
answered on 19 Nov 2012, 04:16 AM
After going through the code again i found out that I accidentally omitted the condition for the first sqldatasource string. sorry for the inconvenience, thanks peoples.
Tags
Grid
Asked by
Bernard
Top achievements
Rank 2
Answers by
Bernard
Top achievements
Rank 2
Share this question
or