Unhandled Exception: System.InvalidOperationException
-
hi When I first executed the program it gave me Table inserted successfully and below the error
Unhandled Exception: System.InvalidOperationException: ExecuteNonQuery requires
an open and available Connection. The connection's current state is Closed.
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean ex
ecuting)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Examples.Class1.Main() in c:\documents and settings\sasi\my documents\
visual studio projects\examples\class1.cs:line 34
Press any key to continueAfter making changes it again me the error connection is aready opened and tables are already existed in the database so i removed the previous changes and deleted the tables from the database .At present I am getting the below error which i cant resolved it.
Cannot drop the table 'emplo', because it does not exist in the system catalog.
Press any key to continuePlease can anyone help me in this !! sasi
-
hi When I first executed the program it gave me Table inserted successfully and below the error
Unhandled Exception: System.InvalidOperationException: ExecuteNonQuery requires
an open and available Connection. The connection's current state is Closed.
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean ex
ecuting)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Examples.Class1.Main() in c:\documents and settings\sasi\my documents\
visual studio projects\examples\class1.cs:line 34
Press any key to continueAfter making changes it again me the error connection is aready opened and tables are already existed in the database so i removed the previous changes and deleted the tables from the database .At present I am getting the below error which i cant resolved it.
Cannot drop the table 'emplo', because it does not exist in the system catalog.
Press any key to continuePlease can anyone help me in this !! sasi
-
in my coding I am dropping the tables if it exists else it should not bother about it and then creating the tables in the database ,if i give some other name for the database still it shows me the same error
Cannot drop the table 'emplo', because it does not exist in the system catalog.
Press any key to continueany idea why it so !! earlier i deleted the table manually from the Enterprise Manager is that the cause for it sasi
-
in my coding I am dropping the tables if it exists else it should not bother about it and then creating the tables in the database ,if i give some other name for the database still it shows me the same error
Cannot drop the table 'emplo', because it does not exist in the system catalog.
Press any key to continueany idea why it so !! earlier i deleted the table manually from the Enterprise Manager is that the cause for it sasi
By Manually deleting the table you did remove it, but there may still be a pointer to the table. In other words the application still thinks the table exists, but cant find it? Try 'Manually' recreating the table (only with minimum data, no need to create entire thing). Then using the proper commands empty the table, THEN delete it. that may fix the problem. otherwise you may need to use a maintenance routine to rebuild your database. ;)