Questions tagged [datatable]

The term "datatable" is ambiguous. In .NET, it's a class that represents a table of in-memory data. In component based MVC frameworks like JSF and Wicket, it's an UI component that dynamically renders a HTML table based on a collection. For jQuery DataTables plugin, please use the [datatables] tag, for the data.table R package please use [data.table]. For the Python datatable package, use [py-datatable].

DataTable in .NET

A DataTable is a .NET class that represents one table of in-memory data. Unlike other programming languages and platforms, a .NET DataTable is not a GUI control but rather a representation of a SQL table directly accessible in code and a source of data for other controls.

A DataTable may exist as part of a DataSet, which represents an in-memory relational data store. In that context, they can be connected through instances of the DataRelation class, and constrained by ForeignKeyConstraint or UniqueConstraint instances.

A DataTable has a set of DataColumn instances, which describe its schema. Data is stored in DataRow instances.

A DataTable may be sorted and filtered without changing the data by attaching it to a DataView. The sorted and filtered rows are then accessed as instances of the DataRowView class.


DataTable in JSF

A <h:dataTable> is an UI component which allows you to render a HTML table dynamically based on a given List<Entity>. You can specify columns using <h:column>. Assuming that Entity is a fullworthy javabean with 3 properties id, name and value, here's an example how you can render a dynamically sized HTML table out of it:

<h:dataTable value="#{bean.entities}" var="entity">
    <h:column>#{entity.id}</h:column>
    <h:column>#{entity.name}</h:column>
    <h:column>#{entity.value}</h:column>
</h:column>

DataTable in Wicket

A data table builds on data grid view to introduce toolbars. Toolbars can be used to display sortable column headers, paging information, filter controls, and other information.

Data table also provides its own markup for an html table so the user does not need to provide it himself. This makes it very simple to add a datatable to the markup, however, some flexibility. (from Wicket 1.4.18 Javadoc)

22197 questions
3
votes
2 answers

Editable datatable in django, backed with mongodb

I'm pretty newbie to world of python, mongodb and django. (coming from java ee world) I have task to represent some collection from mongodb as html table in django. Table should is editable, so rows, columns and fields can be edited, added,…
Sole
  • 61
  • 2
  • 6
3
votes
1 answer

How do I use a java.util.Set with UIData in JSF. Specifically h:datatable?

I know this is not supported in UIData and I understand why, but this should be a common issue for people using JPA and JSF since Sets are the superior collection when mapping M2M O2M relationships. I know I need to create some structure to convert…
Link19
  • 586
  • 1
  • 18
  • 47
3
votes
1 answer

Lazy-loaded primefaces datatable gets updated before SQL statements finish executing

I have a problem when the primefaces data table gets updated before the SQL statements for updating\removing entities from this table finish executing. 01:08:13,255 INFO [reg.data.model.LazyEventDataModelMod] - Loading the lazy event data between 0…
Shajirr
  • 164
  • 3
  • 14
3
votes
1 answer

Searching A Gridview With A DataTable Datasource

I have a gridview that gets its data from a webservice. This comes into the application in a dataset. Me.GvStreets.DataSource = TheWebServiceSearch.AddressDataTable Me.GvStreets.DataBind() Once in the grid view how do I search the…
Paul
  • 1,815
  • 5
  • 27
  • 44
3
votes
1 answer

Disable DataTable change tracking

Is there a way to have data tables automatically accept changes or just disable change tracking when making modifications to rows? When making changes to a datatable, forgetting to call DataTable.AcceptChanges() can cause a real problem.
Dustin Davis
  • 14,482
  • 13
  • 63
  • 119
3
votes
4 answers

How to make all columns allow null before adding a new row?

How to make all columns allow null before adding a new row to the datatable . dt.Rows.Add(dt.NewRow()); This line throws an exception Column XXX does not allow nulls How to fix this problem.
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
3
votes
6 answers

compare datarows of different tables

I posted a similar query some time ago and decided to trim down the complexity of it to let developers answer my main problem. It could be stated as duplicate, but still I want to post it as editing the previous post did not yield much result. I…
Sandy
  • 11,332
  • 27
  • 76
  • 122
3
votes
2 answers

How to return a DataTable from .Net Web Service?

I'v been able to return a HashTable from a Web Service that I setup for a .Net 2.0, but the service fails to retun a DataTable in JSON. I keep getting the following error: 'A circular reference was detected while serializing an object'. Any tips? …
GreenEggs
  • 527
  • 6
  • 17
3
votes
1 answer

How to use BulkCopy without Defining the Destination Table

All, I have the following BulkCopy operation: // Convert the FlexGrid to a DataTable. DataTable currData = (DataTable)c1ErrFlexGrid.DataSource; // Insert the data into the database. SqlBulkCopy SqlBulkIns = new SqlBulkCopy(strConnString,…
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
3
votes
2 answers

How to bind a ListBox to a DataTable from a session object?

I have a session object that contains a DataTable from my previous page, and i would like to bind this DataTable to a ListBox. I'v done this: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if…
liron
  • 121
  • 1
  • 2
  • 7
3
votes
2 answers

ReadXML data and Schema in DataTable

I have two strings. One string is having XML Data and another string is having corresponding XML Schema. I am trying to read the data in DataTable. It looks like it is not possible. I don't want to use dataset. Is there a way I can combine the XML…
Rajkumar Vasan
  • 712
  • 1
  • 9
  • 22
3
votes
2 answers

Output DataTable using StringTemplate

I'm trying to implement a method that will accept DataTable with StringTemplate and return string representation of data. I found how to do this here and here, but it doesn't work for me. Example code: // Here can be any table with any number of…
kyrylomyr
  • 12,192
  • 8
  • 52
  • 79
3
votes
2 answers

Confusion about the appropriate use of datatables and datasets

I've been doing some research on whether what best practice is regarding the use of datatables and datasets and I haven't found any real conclusive answer. Both work for what I want to do but while there is no conclusive answer, the general…
nullexception
  • 131
  • 1
  • 2
  • 10
3
votes
1 answer

How can I find the size of a DataTable row in C#?

Does DataTable in C# provide a property that gives me the size of each row (number of bytes)?
Nimesh
3
votes
1 answer

Select and Update DataTable in Windows Forms

XML 1 Artist 1 His album C://music//song.mp3 2 Artist 1
Andres
  • 2,013
  • 6
  • 42
  • 67