473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Inherit from DataRow

Hi

How to inherit from System.Data.DataRow?

class ItemRow: DataRow
{
public ItemRow(DataRowBuilder rb):base(rb){}
}
Whats wrong with this code?

Best Regards;
Mex
Oct 24 '07 #1
5 4615
Mex,

You are trying to call a constructor which is marked internal. Since
your code doesn't reside in the System.Data.dll assembly, the constructor
isn't available to you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Redivivus" <me***********@deltmar.eewrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Hi

How to inherit from System.Data.DataRow?

class ItemRow: DataRow
{
public ItemRow(DataRowBuilder rb):base(rb){}
}
Whats wrong with this code?

Best Regards;
Mex

Oct 24 '07 #2
Ok, but how can i inherit then from datarow?
Mex

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:eX**************@TK2MSFTNGP02.phx.gbl...
Mex,

You are trying to call a constructor which is marked internal. Since
your code doesn't reside in the System.Data.dll assembly, the constructor
isn't available to you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Redivivus" <me***********@deltmar.eewrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>Hi

How to inherit from System.Data.DataRow?

class ItemRow: DataRow
{
public ItemRow(DataRowBuilder rb):base(rb){}
}
Whats wrong with this code?

Best Regards;
Mex

Oct 24 '07 #3
Redivivus,

Well, you would have to declare your constructor as internal, private,
or protected. Then, you can call the base constructor, passing along the
DataRowBuilder, if you have one available to you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Redivivus" <me***********@deltmar.eewrote in message
news:Ow**************@TK2MSFTNGP04.phx.gbl...
Ok, but how can i inherit then from datarow?
Mex

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:eX**************@TK2MSFTNGP02.phx.gbl...
>Mex,

You are trying to call a constructor which is marked internal. Since
your code doesn't reside in the System.Data.dll assembly, the constructor
isn't available to you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Redivivus" <me***********@deltmar.eewrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>>Hi

How to inherit from System.Data.DataRow?

class ItemRow: DataRow
{
public ItemRow(DataRowBuilder rb):base(rb){}
}
Whats wrong with this code?

Best Regards;
Mex


Oct 24 '07 #4
Oh, and I should note that the constructor is available to you, just in
calling it, you can't elevate the accessibility.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Redivivus" <me***********@deltmar.eewrote in message
news:Ow**************@TK2MSFTNGP04.phx.gbl...
Ok, but how can i inherit then from datarow?
Mex

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:eX**************@TK2MSFTNGP02.phx.gbl...
>Mex,

You are trying to call a constructor which is marked internal. Since
your code doesn't reside in the System.Data.dll assembly, the constructor
isn't available to you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Redivivus" <me***********@deltmar.eewrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>>Hi

How to inherit from System.Data.DataRow?

class ItemRow: DataRow
{
public ItemRow(DataRowBuilder rb):base(rb){}
}
Whats wrong with this code?

Best Regards;
Mex


Oct 24 '07 #5
Ok, but how can i inherit then from datarow?

Consider this alternative. Create a strongly-typed dataset, add your tables
and then have a look at the "YourDataSet.Designer.cs" file. You'll see a
"DataRow" derivative for each table you created as well as a "DataTable"
derivative. Each class has some useful functions noting that the "DataRow"
derivatives in particular have a property wrapping each field (column) in
your tables (very clean to use in code). These are "partial" classes and you
can easily extend them with your own partial class.
Oct 24 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marcel Sottnik | last post by:
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...
4
by: Michael Carr | last post by:
I have a function that populates a class with values from a database. I'd like to pass into the function either a SqlDataReader or a DataRow, depending on which mechanism I'm using to retrieve data...
2
by: Steve Amey | last post by:
Hi all I am binding a DataRow to some controls on a form. When I've finished editing the DataRow I click on a toolbar button to save the changes. If the focus is on a particular control, the...
6
by: JIM.H. | last post by:
Hello I have; DataRow dr= dataSet11.myTable.NewRow(); And I am filling the fields of this datarow. Now I need to create a copy of this row as drCopy and change a few fields and add both to...
1
by: Arpan | last post by:
This is how I am dynamically adding a table to a DataSet: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'Create an empty DataSet Dim dSet As New DataSet ...
5
by: samoore33 | last post by:
I use the code below to search through a DataSet: Dim t As DataTable t = result.Tables("State") Dim strExpr As String strExpr = "id = '" & theState.ToString() & "'" Dim foundRows() As DataRow...
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
5
by: Rainer Queck | last post by:
Hello NG, what would be the best way to locate a DataRrow in a DataGridView? I have by DataTable.Select a bunch of DataRows from a DataTable (which is the data source to the DataGridView). Now...
9
by: myotheraccount | last post by:
Hello, Is there a way to convert a DataRow to a StringArray, without looping through all of the items of the DataRow? Basically, I'm trying to get the results of a query and put them into a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.