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
4
votes
2 answers

Adding Datarow between Rows?

how can i add rows between existing rows in a datatable ? Thanks
subprime
  • 1,217
  • 8
  • 20
  • 34
4
votes
1 answer

DataTables putting tables inside of a datatable

I need to put tables in my datatable, but it doesn't look like datatables likes it. Does anyone know how I can get the functionality I need? I tried putting in divs that look like tables instead of tables, but it still broke. I think because the tr…
Farzher
  • 13,934
  • 21
  • 69
  • 100
4
votes
1 answer

Horizontal scrollbar is not appearing in jquery datatable

I am using jquery datatable to add horizontal and vertical scrollbar in a html table. Everything else is working fine except that horizontal scrollbar is not appearing and horizontal content goes out of screen. I am using the following…
Vishal Suri
  • 41
  • 1
  • 3
4
votes
1 answer

jQuery DataTables Editable - read only if empty value

I'm using the jQuery DataTables Editable to be able to edit data in a table. (Using jQuery 1.7.2) The data is fetched from an Asp.net web service. (See the code below) When a value is empty (for example if one item in the list doesn't have a…
Martin
  • 7,190
  • 9
  • 40
  • 48
4
votes
4 answers

Group DateTime rows in datatable by DateTime - C#

I have a LARGE datatable (500k-1m rows), without going into detail this is a requirement as the end user needs/wants to be able to see all of the data. This is on a local server so bandwidth etc are not concerns for me. I have a DateTime field in…
Faraday
  • 2,904
  • 3
  • 23
  • 46
3
votes
5 answers

Multiple threads filling up their result in one DataTable C#

I'm just beginning to learn the concept of threading, and I'm kind of stuck at this one problem, its driving me crazy.... What I actually need to accomplish - I have some 300 text files in a local directory, that need to be parsed for specific…
Nidhi
  • 667
  • 3
  • 8
  • 12
3
votes
4 answers

sort datatable by a field

var course = from b in DbModle.courses where b.name == "test" select b; DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("name", typeof(string))); …
user1263390
  • 187
  • 3
  • 4
  • 12
3
votes
2 answers

Why doesn't IntelliSense 'know' about my datatable?

I created a dataset (DataSet1.xsd). I then created a TableAdapter (DataTable1TableAdapter) and added a query (images below): When I preview the data, I see exactly what I was expecting: lots of returned rows. In my C# program, in the…
Kevin
  • 4,798
  • 19
  • 73
  • 120
3
votes
5 answers

Icefaces ace:dataTable lazy loading

Is there anybody who have a little example of a lazy loading with ace:dataTable?.. I can't understand how to implement the load method of the class LazyDataModel.. and how to fetch data from a Database through this method.. thanks!
afterbit
  • 383
  • 7
  • 20
3
votes
4 answers

c# How do I specify a not in a select statement?

I'm using a select method on a dataset to retreive the results that match my condition: foreach (DataRow dr in dsPone2.Tables["tt-pone"].Select(strWhereCondition)) { dsPone.Tables["tt-pone"].ImportRow(dr); } How do I change the…
Colin
  • 1,141
  • 1
  • 9
  • 9
3
votes
2 answers

Why does my DataTable not serialize correctly when column names contain spaces?

Normally I try to stay well clear of DataSets and DataTables, but we currently have a requirement where it seems to make sense to use them. I'm having some problems serializing a DataTable when the DataColumn name contains a space and the type of…
JonC
  • 809
  • 8
  • 18
3
votes
2 answers

Enumerate over DataTable, filter items, then revert to DataTable

I'd like to filter items in my DataTable by whether a column value is contained inside a string array by converting it to an IEnumerable, afterwards I'd like to re-convert it to DataTable since that's what my method has to return. Here's my…
Dennis Röttger
  • 1,975
  • 6
  • 32
  • 51
3
votes
4 answers

Default sorting as descending on page load

I am using the below jQuery to sort(descending) table on page load. It is working only after I click the arrows for descending or ascending.But,my requirement was to sort the table descending on page load.Any help is…
1078081
  • 141
  • 2
  • 4
  • 11
3
votes
6 answers

Getting the Foreign Key constraints of a table programatically

I'm trying to use a DataTable to get the schema of a SQL Server DB. But, when try to detect the ForeignKeys, the constraints collection only brings the UNIQUE constraints. Private Sub ShowConstraints(ByVal tableName As String) Dim table As…
Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206
3
votes
2 answers

Play Framework: How to render a table structure from plain SQL table

I would be happy to get a good way to get the "table" structure from a plain SQL table. In my specific case, I need to render JSON structure used by Google Visualization API "datatable"…
Max
  • 643
  • 11
  • 27