There are two problems in the code you posted.
1. Classes cannot inherit from instances.
You wrote
Public class ClassA : DataSet1.DataRow1
This makes the class ClassA inherit from DataSet1.DataRow1. From the usual naming conventions, this looks like DataRow1 is an object of type DataRow.
So make it
Public class ClassA : DataRow
instead.
2. Using a non-existent constructor doesn't work
You are trying to create an instance of ClassA via
new ClassA();
You use a constructor that doesn't take any parameters. But in your given code, the only constructor for ClassA takes one parameter of type
DataRowBuilder
.
If you don't provide any constructors, the compiler silently creates one without parameters. That's why you can use it in simple classes without writing it beforehand.
This shortcut is disabled as soon as you provide any constructors. So you're left with two options:
a) Write another constructor that works without parameters or
b) In ClassB.DoWork() use the existing ClassA constructor like
new ClassA(someDataRowBuilderThatIsValidInThisScope);