OK, so I'm a newbie at this stuff: I've learned how to drop a SqlDataSource onto my .aspx page and then drop various controls ( Gridviews, Datalists, etc) and configure them to display various SQL data, and then Create, Retrieve, Update and Delete (CRUD) stuff, all (or mostly) in the markup. It's cool; it's fun; it's easy.
Now I want to also look at stuff in my database in the code-behind, in C#. I'm going to use that put up messages, make suggestions, or change colors on the displayed page but I'm not going to directly display what I've queried. What's "best practice" for that? Is there a way to access the SqlDataSource in my C#, and use the connection it's already made to my database? The SqlDataSource class seems to have useful methods. Or should I make a separate connection to the database in my C# code? Or wh ...
Go to the complete details ...