1

I am using in my app in SqlDataSource to fill a dropdownlist ,i configure it in the web design in Visual studio.

i want that this dropdownlist will change dynamically by a couple of table in the sql.

it is possible to change the SqlDataSource programmatically from code?

0

1 Answer 1

5
SqlDataSource source = new SqlDataSource(connectionString);
source.SelectCommand = String.Format("SELECT id, type FROM {0}" selectedTable)
source.DataBind();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.