Questions tagged [selectcommand]

48 questions
0
votes
2 answers

SqlDataSource set SelectCommand dynamically

I'm using a SqlDataSource and to avoid writing long queries directly in my code I thought I could make a Query class that returns the query I want as a string. I tried the code below but I just get "Server tags cannot contain <% ... %> constructs."…
Martin
0
votes
3 answers

SELECT SqlCommand

I know this is a simple question, but I can't get it to work. This is my query in my SqlCommand: SELECT * FROM zipcode WHERE city LIKE @prefixtext + '%' ; I only want 10 results, every other answer suggests SELECT TOP 10 * FROM zipcode WHERE…
Scott Selby
  • 9,420
  • 12
  • 57
  • 96
-2
votes
1 answer

Populating the SQLDatasource SelectCommand

How do I take this string and drop it into the select command? String SqlC = "select * from dbo.FindIt where " + SqlStr; The object is to populate the SelectCommand:
Juliemac
  • 7
  • 4
1 2 3
4