Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubSonic.Query.QueryCommand - ExecuteNonQuery requires an open and available Connection using #250

Open
luisvsilva opened this issue Jan 4, 2011 · 0 comments

Comments

@luisvsilva
Copy link

Using Multiple Providers. To reproduce exception:

IDataProviderProvider = ProviderFactory.GetProvider("BlahProvider");
new SubSonic.Query.QueryCommand(
                   "Delete from foo", Provider
               ).ToDbCommand().ExecuteNonQuery();

This works fine:

SubSonic.Query.QueryCommand query = new  SubSonic.Query.QueryCommand( "Delete from foo",Provider);
Provider.ExecuteQuery(query);

StackTrace:

System.InvalidOperationException was unhandled
Message=ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
Source=System.Data
StackTrace:
at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant