Last post Sep 05, 2013 03:59 AM by Starain chen - MSFT
Sep 04, 2013 06:31 AM|Suchiedu13|LINK
I am a newbie to this form and new into the world of Web and Cloud Computing. I am currently studying and have been asked to install Visual Web Developer 2010 Express to my laptop. I installed the following
a) Microsoft Sql Server 2008 R2 (installed first)
b) Installed Visual Web Developer 2010 Express.
I created a new empty Website using ASP.NET Web Site within WEB Developer 2010 Express.
I then created an App Data for my data base.
I could create table names and column names. However when i try to view the table command - I get an message saying - "Operation is not valid due to current state of Object.". I have carried couple of times to uninstall and re-install
a) SQL Server 2008 R2 ( Inc Service Pack 3)
b) Visual Web Developer 2010 express.
My OS is Windows 7
I would really appreciate if any body could advise. i couldn't post snapshots of the error page.
Sep 05, 2013 03:59 AM|Starain chen - MSFT|LINK
Thanks for your post!
According to your description, you are troubling with retrieve data from SQL DataBase.
Do you use the method of ExecuteReader()?
If so, please check the state of SqlConnection. The state of SqlConnection should keep opening while you using
ExecuteReader() to retrieve data.
Here is a simple sample below that may benefit you:
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MessageInfoConnectionString"].ConnectionString))
SqlCommand cmd = new SqlCommand("select * from EmptyDb", conn);
SqlDataReader r = cmd.ExecuteReader();
object s = r;
If you still have the issue, please provide your code to me.