Closed madrianr closed 6 months ago
v8 changes the default sql provider from System.Data.SqlClient
to Microsoft.Data.SqlClient
and no longer automatically packages the System.Data version by default. If you were on a previous version of Insight, you're likely using the System.Data version.
So, double check which SqlClient your code is using. If you're using System.Data.SqlClient
, you should just need to:
Insight.Database.Providers.Default.SqlInsightDbProvider.RegisterProvider();
Thanks - adding Insight.Database.Providers.Default solved the problem robert
Describe the bug
After Upgrading to Version 8.0 I get the follwing error: _NotImplementedException: Cannot derive parameters for the stored procedure SELECTFachgruppenuser. Have you loaded the provider that supports SqlCommand?
public static IList SPSelect(HttpContext context, IDbConnection db, string sql, object parameters = null)
{
IList result = null;
IWebHostEnvironment env = (IWebHostEnvironment)context.RequestServices.GetService(typeof(IWebHostEnvironment));
result = db.Query(sql, parameters, commandType: System.Data.CommandType.StoredProcedure);
return result;
}
I have registered using Insight.Database.Providers.MsSqlClient; ... SqlInsightDbProvider.RegisterProvider();