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
3 answers

Issue with empty columns in tab delimited text file

i am trying to create a data table from a tab delimited text file.I am getting the values from the file easily.The problem is that when there is a empty column in text file same empty column is not created in data table instead the next non-empty…
Karthik
  • 2,391
  • 6
  • 34
  • 65
3
votes
2 answers

Syncing DataTable autoincremented columns with Database

The DBConcurrencyException issue occurs when trying to use the Update() method on my Database. I have a table in a database that has an autoincremented ID column, and a DataTable in my c# program that gets its information from this table (including…
NikonTC
  • 31
  • 3
3
votes
2 answers

DataTables place search and entries filter under the table?

Can I place the Show entires filter in the search filter under the table instead of above the table? See: http://datatables.net/release-datatables/examples/basic_init/alt_pagination.html And I know I can place een position : absolute and stuff but I…
Maanstraat
  • 1,241
  • 7
  • 34
  • 63
3
votes
5 answers

how to create a class automatically from datatable

I know there's a cleaner way to do this than the way I am. Basically, I retrieve a datatable from my sql database. I now want to have that information in a class that is globally accessible. I don't want to have to go through each column like so:…
user948060
  • 953
  • 3
  • 12
  • 25
3
votes
5 answers

Should AcceptChanges() be called every time a new row is added?

Which is recommended while (reader.Read()) { table.Rows.Add( new object[] { reader[0], reader[1], reader[2], reader[3] } ); table.AcceptChanges(); } or while (reader.Read()) { table.Rows.Add( new…
Saif Khan
  • 18,402
  • 29
  • 102
  • 147
3
votes
4 answers

DataTable Select() with Guids

I am trying to boild my treeview at runtime from a DataTable that is returned from a LINQ query. The Fields returned are: NAME = CaseNoteID | ContactDate | ParentNote TYPE = Guid | DateTime | Guid The ParentNote field matches a entry in…
Refracted Paladin
  • 12,096
  • 33
  • 123
  • 233
3
votes
1 answer

How to update data from datatable to sql table?

I have an sql table with ID(unique) Name status 1 A 0 2 B 0 In my code, I retrieve all data into a data table and do some coding. Based on the results, I will change the results from 0 to 1 or 2 After that, I need to update…
william
  • 7,284
  • 19
  • 66
  • 106
3
votes
2 answers

Adding new rows dynamically in a grid view or datatable in asp.net?

I am binding the grid view using data table. My task is to add new rows to my grid view dynamically when the user clicks "ADD" button in grid view it should generate new row with three text boxes. For example: When I click the add button in the…
user414320
  • 61
  • 1
  • 1
  • 7
3
votes
1 answer

Filter DataTable in Primefaces only works once

I'm trying to filter a dataTable using Primefaces much like this example. (In a web browser) I type the text I want to filter by, it works once but when I remove the text I've written the result stays the same when it should go back to it's original…
Dennis S
  • 858
  • 1
  • 18
  • 32
3
votes
3 answers

Can't Get DataTable to sort

I am trying to do a simple sort in a DataTable but have no success. The C# code is listed but what is needed for the corrections: using System; using System.Data; using System.Xml; namespace XMLParser { internal class Program { …
heavy rocker dude
  • 2,271
  • 8
  • 33
  • 47
3
votes
2 answers

In DataGridView turn ReadOnly property of column to false when adding new row, on updating its true (c#.net)

I have set the readonly property of 2 datatable columns to true. List.Columns[0].ReadOnly = true; List.Columns[1].ReadOnly = true; But i only want them to be read only when user is trying to update, User can add new rows to dataGridView so…
PUG
  • 4,301
  • 13
  • 73
  • 115
3
votes
2 answers

Primefaces LazyModel datatable always calls for first=0 pageSize=10

I am using the LazyDataModel to populate a a table with 33 items(A sub set of a long list of parts and can grow or shrink) in pages of 10. the table deceleration is as follows
user845854
  • 81
  • 3
  • 9
3
votes
1 answer

load a datatable to an existing table in dataset

how can in load a DataTable to an existing table in my DataSet. something like this: DataTable my_table = new DataTable("sale_info"); **add some row to my_table ** myDataSet.Tables.Add(my_table); i have a table named sale_info in myDataset too and…
hamze
  • 7,061
  • 6
  • 34
  • 43
3
votes
1 answer

jQuery UI icons sprite overflows in

I have a with .
SK.
  • 1,390
  • 2
  • 28
  • 59
3
votes
2 answers

JSF f:ajax cannot locate component on context

I'm trying update one dataTable from a graphicImage inside the dataTable. I tried a lot of combination of f:ajax render value but without success, now I'm using p:component function of PrimeFaces, but I get the same error before. I receive this…
brevleq
  • 2,081
  • 10
  • 53
  • 97