majkinetor
Programmer
I am overriding DbDataAdapter class with custom class that looks like this:
I am using this to class since there is protected method "Fill" that I want to use. Other methods are here because they must be overriden.
Anyway, when I put this code into Namespace for my ASPX project along with main page everything works fine and application can be compiled and executed.
But when I use "View Designer" or double click to .aspx file, the following message appear (I used copy/paste of isued dialog)
When I remove above class from the source I can switch to designer view.
Can anybody help me with this, give me some tip or something, since I must comment this class every time when I want to design. I tell again here, that application executes normally.
Thx.
Code:
public class DbDataAdapterEx : DbDataAdapter
{
// Fill DataTable using DataReader as a source
public int FillFromReader(DataTable dataTable, IDataReader dataReader)
{
return this.Fill(dataTable, dataReader);
}
protected override RowUpdatedEventArgs CreateRowUpdatedEvent(
DataRow dataRow,
IDbCommand command,
StatementType statementType,
DataTableMapping tableMapping
) {return null;}
protected override RowUpdatingEventArgs CreateRowUpdatingEvent(
DataRow dataRow,
IDbCommand command,
StatementType statementType,
DataTableMapping tableMapping
) {return null;}
protected override void OnRowUpdated (RowUpdatedEventArgs value ){}
protected override void OnRowUpdating(RowUpdatingEventArgs value){}
}
I am using this to class since there is protected method "Fill" that I want to use. Other methods are here because they must be overriden.
Anyway, when I put this code into Namespace for my ASPX project along with main page everything works fine and application can be compiled and executed.
But when I use "View Designer" or double click to .aspx file, the following message appear (I used copy/paste of isued dialog)
---------------------------
Microsoft Development Environment
---------------------------
The file could not be loaded into the Web Forms designer. Please correct the following error and then try loading it again:
The designer must create an instance of type 'System.Data.Common.DbDataAdapter' but it cannot because the type is declared as abstract.
Make sure all of the classes used in the page are built or referenced in the project. Click Help for more information.
---------------------------
OK Help
---------------------------
When I remove above class from the source I can switch to designer view.
Can anybody help me with this, give me some tip or something, since I must comment this class every time when I want to design. I tell again here, that application executes normally.
Thx.