"Значение не может быть нулевым.\r\nparameter name: providerinvariantname"}, в форме C# windows, ошибка dbprovider factorie (dataprovider name) not null как исправить эти ошибки
public static DbCommand CreateCommand() { //WebConfigReader // Obtain the database provider name string dataProviderName = WebConfigReader.DbProviderName; // Obtain the database connection string string connectionString = WebConfigReader.DbConnectionString; // Create a new data provider factory DbProviderFactory factory = DbProviderFactories.GetFactory(dataProviderName); // Obtain a database specific connection object DbConnection conn = factory.CreateConnection(); // Set the connection string conn.ConnectionString = connectionString; // Create a database specific command object DbCommand comm = conn.CreateCommand(); // Set the command type to stored procedure comm.CommandType = CommandType.StoredProcedure; // Return the initialized command object return comm; } } }
Что я уже пробовал:
я попытался изменить имя dbprovider и строку подключения как это исправить