.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

deriving from DataRow

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :WCF
Hey guys, I am producing a 3-tier application similar to the walkthrough at http://msdn.microsoft.com/en-us/library/bb384570.aspx I have several tables on my SQL which are nicely generated into objects which I can handle and render on the presentation tier. The first question is: What is the best way to access individual of these objects which the presentation tier received? My impression is that the structure of the strongly named DataRow class is essentially the same as the object on the server so why don't I work with that one, and e.g. write DataEntityTier.DataSet.TestRow testRow = new DataEntityTier.DataSet.TestRow(); testRow.id = 123; testRow.text = "here goes some text";<span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="white-space:normal"> </span></span> This would be nice, since I have all the objects I need (and can sync, search, update, ... with my SQL through the 3-tier application) accessible via the "testRow" object. Only problem now is that the first row won't compile since "TestRow" which is derived from "System.Data.DataRow" does not provide an accessible constructor. This was the first problem. Second (related) problem: Since I can somehow get the desired data to the presentation-tier it would be neat if those objects could have additional functio

View Complete Post

More Related Resource Links

datarow data insertion error


this is the code which i am using and what i want means when i==0 first record should bind to datatable and when i==1 2nd record should bind to datatable. that means when i==1 1st and 2nd record should be present in datatable  Please see the code below


when i am binding 2nd record to datatable 1st record is getting deleted and recently inserted value is getting inserted please tell me how to resolvie this


datatable dt11=new datatable();
DataRow row11=null;

if (i == 0)
row11 = dt11.NewRow();

row11["qid"] = qnumber;

row11["question"] = question;
row11["useranswer"] = correctans;
row11["flag"] = answerstatus;


if (i == 1)

qnumber =ds5.Tables[0].Rows[i][0].ToString();
question =ds5.Tables[0].Rows[i][1].ToString();

row11 = dt11.NewRow();

who to load DataRow to DataTable



Who can I copy data from DataRow[] to DataTable....

DataRow[] TempDataRowFilter;



DataTable TempFilterTable = new DataTable();
TempFilterTable.LoadDataRow(TempDataRowFilter, true);

It is error why ?         

Moving Datarow from datagridview to textboxes

Hi , I need to know how to copy a datarow from datagridview to subsequent textboxes.I have three textboxes and three fields in datagridview .

Custom sequence activity deriving from System.Workflow.Activities.SequenceActivity

Hi, I try to create custom sequence activity. I found some sample (http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/f54e8eb2-29d9-46f6-ad96-766fe6fad333/). But this custom activity looks ugly (to separate nested activity using ellipses instead of arrows). My question is - how to create custom sequence activity, which will look like sequence activity. I also found this sample - <ContentPresenter x:Uid="ContentPresenter_1" Content="{Binding}" Style="{x:Static sacdt:DesignerStylesDictionary.SequenceStyle}"/> When I used this ContentPresenter my custom activity looks like System.Workflow.Activities.SequenceActivity, but I couldn't put on it another activity. I also created class, which derives from System.Workflow.Activities.SequenceActivity, but I couldn't see it in toolbox. My question is - how to create class, which derives from System.Workflow.Activities.SequenceActivity and is visible in toolbox or how to use ContentPresenter for sequence activity, which allows put on itself another activity.

[TreeView,DataSet] Howto get a TreeViewItem for a DataRow?



There's a TreeView bound to self-referencing data table. The TreeView itself bound to view filtered to nodes with ParentID is null. The nodes uses following template:

        <HierarchicalDataTemplate ItemsSource="{Binding FK_Nodes_Nodes}">
          <TextBlock Text="{Binding SomeText}" />

I want to autoscroll

how to store array values into datarow


Hi I have   string array values in


Dim _arr_Entry_Ids() As String = Split(_Entry_Id, ",")

i want to store this array values in datatble column

dt = New DataTable


For i as integer 1 to 5

dr("v1") = _arr_Entry_Ids

dr("R1")="some text"


Dataset stored in db export to Datarow


I have a database field that is stored as a dataset xml string in order to capture multiple and different data elements. I can successfully pull this information out of the database, format to a dataset and export it to an excel file. 

My issue is that these are stored as datasets as opposed to datarows and because it is stored to a dataset it retains the dataset header info which I really do not need. I really would rather not have to manually parse this data so I am thinking that I could peel the data row out of each data set then plop them into a new dataset, yes?

Transferring of DataTable Vs its List for a WCF?


I am trying to see if returning a DataTable containing 5000 records would be faster if I return instead a List<DataRow> collection from the WCF method. May be the List<DataRow> will have a smaller payload that that of original DataTable when sent via WCF ?



Returning a blank DataRow



Hope this is a simple one, can't get my head around it...

I have a method like

public DataRow GetItem(ENTITY_TYPE EntityType, long EntityID)

This fetches a row and returns it. Pretty simple.

However I can't test in the method to see if the row was fetched, as the method has to end with:

Returning a DataTable as List in WCF with WsHttpBinding

  • Would it be better in terms of payload, if I return a datatable as a List<DataRow> from a WCF method? I have WsHtppBinding for my WCF. I am expecting the datatable to contain 5,000 to 10,000 records.
  • Also, how can I test the difference in payload sizes when returning a DataTable Vs List<DataRow>?


DataTable DataRow Value Assumed to be Number


My app reads in a .CSV file and parses it using the dAdapter.Fill(dTable) method.

This works fine and I can see the data in rows in the DataTable.

One of the fields in the .CSV file is "Customer Number".  When this value is put into the DataTable it is automatically added as a number type field.

When I try to read the DataRow value from that DataColumn I get an error because it is not a string type.


foreach (DataRow dr in myTable.Rows)






curItem.Item["CustNumber"] = <strong>dr["Customer Number"];</strong>





I have tried converting it to string and to int32 but nothing seems to work.

How do I convert it to a string?


how to add linkbutton into datarow


private Controller ctl = new Controller(); ..... DataTable db1 = new DataTable(); ArrayList arr1 = new ArrayList(); arr1 = ctl.getAlljob(); db1.Columns.Add("IDjob"); db1.Columns.Add("product"); .... db1.Columns.Add("report"); foreach (Job j in arr1) { DataRow dr = db1.NewRow(); dr["IDjob"] = v.getjobid.ToString(); .... dr["report"] = "<a href='#'>Report</a>"; <=== it show "<a href='#'>Report</a>" but i want to it show as report linkbutton db1.Rows.Add(dr); } GridView1.DataSource = db1; GridView1.DataBind();

'System.Data.DataRow' not marked as serializable




I am getting the following error when attempting to persist my work flow.


Type 'System.Data.DataRow' in Assembly 'System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.


Any ideas?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend