Re: SqlCommand SQL statement 'stuck'

Tech-Archive recommends: Fix windows errors by optimizing your registry



SELECT distinct city from doctors.

Try it.

Alex

"KevinRug" <kevinrug@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OxqM97FQFHA.2932@xxxxxxxxxxxxxxxxxxxxxxx
> In the code below, I am trying to change the select statment to be
> "distinct" , ( i have also tried "top 1"), but when the code runs I always
> get the original query "Select city from doctors".
>
> Here is a code extract
>
> SqlCommand cmdCities = new SqlCommand("Select city from doctors",
> sqlConnection1);
> SqlDataReader drCities;
> sqlConnection1.Open();
> drCities = cmdCities.ExecuteReader();
> lstCities.DataSource = drCities;
> lstCities.DataTextField = "City";
> lstCities.DataBind();
> drCities.Close();
> sqlConnection1.Close();
>
>
>
>
> Any ideas as to why the query changes are not being accepted?
>
> Kevin Ruggles
>
>


.