DataRow specialization

M

Marcel Sottnik

Hello group

Maybe this is not the right NG, but this problem seems to me to be more
language related than ADO.NET.

How can I write the constructor for specialization of DataRow which will
take a datarow as parameter. Something like:

class MyDataRow : DataRow
{
public MyDataRow(DataRow row) : base(row)
{
}
}


Thx
 
B

Boaz Ben-Porat

Base class - DataRow doesn`t have a public constructor, so 'public
MyDataRow(DataRow row) : base(row)' gives a syntax error.

You can use the 'semi-hidden' constructor protected internal
DataRow(DataRowBuilder builder);

Microsoft discourages use of this member.

This is a snippet from a typed DataSet generated by Visual studio
(Generated code):

public class KukuRow : DataRow
{
private KukuDataTable tableKuku;

internal KukuRow(DataRowBuilder rb) :
base(rb)
{
this.tableKuku = ((KukuDataTable)(this.Table));
}

......

}


Hopes it helps

Boaz ben-Porat
Milestone Systems
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top