datatable

Databind only 3 columns of a table in Gridview

Hey i have a simple ASP.NET application Table with this schema: id | Owner | Customer | SentOn | Deleted |. I want the gridview to show only Owner | Customer | SentOn columns of the DataTable which is inside the DataSet. How can i do this? Note: I want to do this programmatic without any dataSource Controls. I want to display CheckBox...

<h:dataTable value=#{myBean.xxx}>: getXxx() get called so many times, why?

Simple piece of code about dataTable. CentralFeed is SessionScoped Bean, and PostComment is RequestScoped Bean <h:form id="table"> <h:dataTable value="#{CentralFeed.profileComments}" var="item"> <h:column> <h:outputText value="#{item.comment}"/><br/> <h:inputTextarea value="#{item.newComment}" rows="2...

select distinct from dataset

I have got duplicate rows in a dataset. how can i select distinct rows from that. From comments: My query is something like this: select name, age from student When I receive its output in a dataset the output consists of rows having duplicate names. Using dataset itself I have to select distinct name from this because I need the s...

How should I design an data table that has six or more variables?

The situation is akin to the following: Assume I am a store selling fruits, I would like to record the costs of each type of fruit. Assume the customer has specific tastes, and they can differenciate everything. A fruit can be an orange, apple, pear, or peach It could be n days fresh from the vendor The fruits come from different cou...

ASP.NET DataView - problem with RowFilter and application cache

Good afternoon ladies and gents -- I've been tasked with finding and fixing a bug in an unfamiliar legacy application that had some recent changes made to it, but I don't have an easy way (that I know of) to test my theory. I'm hoping your collective knowledge will verify the test for me. This application lazy loads lookup lists (tongu...

Sorted dataview to datatable

Hello, i have the following method: private DataTable getsortedtable(DataTable dt) { dt.DefaultView.Sort = "Name desc"; //I would need to return the datatable sorted. } My issue is that i cannot change the return type of this method and i have to return a DataTable but i would like return it sorted. Are there any magic hidde...

Locate row in DataGridView when bound DataView sorted by different column in .NET

I have a DataGridView with a DataTable set to its DataSource. The DataTable has two columns. The user has a TextBox which dynamically (after each keypress) searches for a match in the first column. I want to jump to the matching record (if any) after each key entry, so it needs to be fast. I use the Find() method on the DefaultView of ...

How to persist DateTime Kind while storing a datetime object into a data table?

Hi, I’m facing an issue with storing the DateTime object into a datatable, it looses the Kind information set into it.For example if the DateTime.Kind is UTC, once I assign it to the datarow value it changes the Kind to Unspecified.Please find the code below. public class LocalTimeToUtcConverter { public DateTime Convert(Da...

How to get a datatable from a listbox

I have populated a list box using a Data-table. In another method, I have to retrieve the data table from the list box. Datatable dt = (DataTable)lstExample.DataSource; Throws an error, that the Datatable dt is null I am working on c# ASP.Net ...

ADO.NET: query a DataTable on a timeout

Hello, I have an in-memory DataTable that contains two fields of type DateTime, respectively LastAction and LastHeartbeat meaning the last time an entity sent an activity log message and the last time the entity sent a heartbeat ("I'm alive") log message. I'm building a method to query the data table with various criteria, including the...

copy rows from Datatable to another Datatable c#

how can I copy specific rows from datatable to another datatable in c#? more than on row ...

Need to fill datatable on click of a button. (using control of datatables.net)

I am using a custom control of datatables.net. Hi i need to fill the datatable on click of a button. this is the code that i have written on Load of the form $('#dtlist').dataTable({ "bPaginate": false, "bFilter": false, "bServerSide": true, "bSort": true, "sAjaxSource": 'Aja...

Set ID of each line on a link in a dataTable

I have a page that lists all from my Post table, it looks like this: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>TODO supply a title</title> </head> <body> <p...

Merge DataTables LeftJoint(1:n) in one DataTable creating new Columns

Hi, I searching to expose in one DataTable parent and Childs items creating new columns for the repeating childs. The object is merge the main DataTable with child items creating for each child a new row and add them inside.I need to expose a single DataTable with all inside. Can someone propose me the best way?. Thanks DataTable Paren...

Databinding in .NET - Datatables, Dataviews and BindingSources

Hello, When binding to datatables in visual studio, it sets the datasource of a bindingsource to the selected datatable - which is fine and is what is expected. However, the datasource is actually pointing to a dataview of that datatable. I'm currently implementing custom business object base classes which include collection classes. I...

What is the best way to visualize a DataTable while debugging?

I have some very big DataTables, which I need to see their content while debugging. Is there a better way to do that other than opening the Columns' and rows' lists Properties in the Watch panel? Thanks. ...

JSF datatable does not update when deleting first line

I am working on making a jsf datatable backed by a database. I am currently using a CachedRowSet to provide data. A command link allows the user to delete a line in the CachedRowSet by calling a method of the backing bean. The delete method works fine, but whenever the user tries to delete the very first row of the datatable something...

Using dataTable Primefaces

Hello, I am using the dataTable object of primefaces to display some data and I am having some problems to realize something : I display first a table with only 1 column and I want to display another table filled with data depending on what the user selected on the first one. For that, when the user selects a row in the first table, I...

weird jQuery dataTables rendering issue

Hi all, I'm working on a web app that uses menus (fg.menu) and jQuery UI tabs. These work great. I'm now trying to apply the dataTables plugin to the tables that I'm loading (via Ajax) in my tabs. The tables are generated on the server side (JSON is not an option right now) and sit in static files that I load into the tabs. The tables h...

Adding a datatable to a database programmatically VB.NET

I am trying to add a datatable to a database. Here's what I've been trying: Dim newDataTable As DataTable = New DataTable("Example") VocabularyDataSet.Tables.Add(newDataTable) SqlDataAdapter1.Fill(VocabularyDataSet.Tables("Example")) I've tried various incarnations of Fill and Update. But the tables will not save on the ...