O.o first to answer your question.
You have never supplied the Connection to the SqlCommand so it has no idea what it is supposed to connect to! You need to do something like: SqlCommand1.Connection = con
Also, am I right in assuming that you are fairly new to programming?? The reason I ask is because this code does not lend itself well to reuseability at all since everything is hardcoded.
I would suggest adding a class to your solution that handles all of your database functionality and you just return the necessary objects from that class and work with those objects in your calling class.
Also, you should never never never leave SQL Servers SA account setup with a blank password, that is asking for all sorts of trouble.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========