Set SqlDataSource in code behind

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
 
C

Christopher Reed

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top