Set SqlDataSource in code behind

  • Thread starter Thread starter staeri
  • Start date Start date
S

staeri

Hello!

I would like to set the SqlDataSource in the code behind file and not
to have it in the aspx file. How can I do that?

Regards,

Staeri
 
Instantiate a SqlDataSource object in your code, probably in your
code-behind.

SqlDataSource sdsData = new SqlDataSource();

There are two other constructors for SqlDataSource. Look at the MSDN
documentation for more information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top