My query does not seem to be responding in my code, however, in the SQL scripting area my script executes cleanly. The issue at hand must just be the way that I am inserting the variable from the rest of the query such as adding the parenthesis on the end but doesn't get read. I'm doing this in a .NET Gridview. Any ideas would be appreciated. Please let me know if you need more information.
SQL (no issues):
SELECT [TeamID], [TeamName], [SportsType], [ContactName], [ContactPhone], [ContactEmail] FROM [Teams] WHERE CompanyID = (SELECT CompanyID FROM Company WHERE companyadminUserName = 'rec1') OR CompanyID = (SELECT CompanyID FROM Employee WHERE EmployeeBarcodeNumber = 'rec1')
In Code (issues):
public String loggedInUser = "rec1";
SqlDataSource1.SelectCommand = "SELECT [TeamID], [TeamName], [SportsType], [ContactName], [ContactPhone], [ContactEmail] FROM [Teams] WHERE CompanyID = (SELECT CompanyID FROM Company WHERE companyadminUserName ="+loggedInUser+") OR CompanyID = (SELECT CompanyID FROM Employee WHERE EmployeeBarcodeNumber ="+loggedInUser+"')'";