FAQ Database Discussion Community


dataview.rowfilter syntax error - missing operand mystery

vb.net,datagridview,datatable,dataview,rowfilter
Weird, weird error. I might just be codeblind, but: Dim dtdv As New DataView dtdv = dt.DefaultView dtdv.RowFilter = "Controller ID = 'PS2USB1'" XMLDGV.DataSource = dtdv produces, at line 3: Missing operand after 'ID' operator. dt defined and correct. Column heading correct. Weird. Any ideas?...

how to remove a row from datatable

c#,winforms,datatable
I'm trying to remove/delete 1 row from datatable which has 100 rows like this: Form1.dt.Rows[i].Delete(); Form1.dt.AcceptChanges(); but further down when i get the count of the rows of the table like : int rc = Form1.dt.Rows.Count; the rc still returns 100! does Form1.dt.Rows[i].Delete(); clear the row and leave it empty...

filtering not working from select

jquery,table,datatable,filtering,html-select
I have created a application with dataTable with fixed headers and sorting, the application is working fine but the issue is that I am having a name filtering through a drop-down, which is not working when I select a particular name. My code is given below. Can anyone please tell...

jQuery DataTables Column Show/Hide Toggle using Bootstrap Modal

jquery,asp.net-mvc,twitter-bootstrap,datatable
I have a table and I am using jQuery data tables. I wanted to have an option to show/hide a column(s) in my table and I saw this: https://datatables.net/examples/api/show_hide.html In this example, it is done by clicking a link to toggle the show/hide of the column. But what I want...

How to Filter a DataView by another datatable row attribute

c#,datatable,dataview
I have 2 methods that I do not have any control over. One returns me all dates with needed unique code(one of the row column row[code]) as DataView. DataView allDatesWithCode= portal.GetAllDatesWithCode(); And another method returns me only available dates but without the code. DataTable availableDates = portal.GetAvailableDates(); Both allDatesWithCode and...

JSF NumberFormatException with f:setPropertyActionListener

jsf,datatable,el,jsf-2.2,setpropertyactionlistener
I'm getting this error with f:setPropertyActionListener and i can't figure out why: HTTP Status 500 - For input string: "selectedItem" exception: javax.servlet.ServletException: For input string: "selectedItem" javax.faces.webapp.FacesServlet.service(FacesServlet.java:667) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause: java.lang.NumberFormatException: For input string: "selectedItem" java.lang.NumberFormatException.forInputString(Unknown Source) java.lang.Integer.parseInt(Unknown Source)...

Bootstrap datatable pagination only showing buttons but not working in Grails

twitter-bootstrap,grails,datatable,pagination
I am using Grails 2.4.2. and bootstrap datatable for Grails. All works fine for datatable in my index page except for pagination. It shows all the related buttons for pagination but don't paginate. Also there is another div where paginate also shown and work but not with datatable ? Here...

datatable with html content

jquery,html,checkbox,datatable
I am using jquery datatable and data input injson format. $('#newItemBasketTab').dataTable({ "aaData": result.itembasketdata, "aoColumns": [ {"mDataProp": "nic5dcodename"}, {"mDataProp": "asiccprodcodename"}, {"mDataProp": "unit_name"}, {"mDataProp": "prod_quantity"}, {"mDataProp": "prod_value"} ] }); Now I want to place a checkbox in first column of datatable and based on an ID field in json data, the checkbox...

Refresh selection model of p:datatable on row deselection

jsf,primefaces,datatable,selection
I have a problem with the selection model of a Primefaces 5.0 datatable. This selection model does not process deselection properly: Selection of rows adds these roles as expected to the list of selected rows. But a deselection has no influence on this list; deselected rows remains in it. Only...

Column [key] throws MissingPrimaryKeyException in dataTable

c#,datatable
var sdr = db.ExecuteReader("SELECT [key],translation FROM language WHERE [email protected]"); DataTable someTable = new DataTable(); someTable.Load(sdr); return ((string)(someTable.Rows.Find("[key] = CUSTOMDATEFORMAT").ItemArray[1])); The last line now throws the error System.Data.MissingPrimaryKeyException: "The table has no primary key." So I guess it finds the keyword "key" and now expects me to query on the...

p:dataTable not showing updated records from database on Dialog close

ajax,jsf,primefaces,datatable,dialog
I need your help in refreshing the dataTable component on closing the Dialog. I tried many ways to refresh the dataTable, but it is not retrieving the updated record, unless I have refreshed the full page by clicking on the "Go" button which is next to the URL in the...

HIVE: apply delimiter until a specified column

hadoop,datatable,hive,delimiter
I am trying to move data from a file into a hive table. The data in the file looks something like this:- StringA StringB StringC StringD StringE where each string is separated by a space. The problem is that i want separate columns for StringA, StringB and StringC and one...

How to select rows from a DataTable where a Column value is within a List?

asp.net,.net,vb.net,linq,datatable
Say you had a table in SQL and you wanted to find all the rows where a particular column could be one of 3 options. You could write something like this: SELECT * FROM MyTable WHERE uid IN (123, 456, 789) That's effectively what I want to do with a...

Filtering DataTable that contains objects

c#,.net,datatable
Before I had a DataTable filled with string values. I used the Select method to filter data and it worked very well. DataRow[] drs = dataTable.Select("[" + dataTable.Columns[columnIndex].ColumnName + "] LIKE '%" + filter + "%'"); After some time the string values in the DataTable had to be changed to...

DataTables search child row content

jquery,datatable,datatables,jquery-datatables,datatables-1.10
The DataTables search bar does not let me search for content within child rows. I have searched extensively to find the answer to this (1, 2, 3, 4, 5, 6, 7, 8, 9), but there are little to no responses on the issue. Here's a simple jsfiddle and DataTables debugger...

DataTable.Rows returns second row in c#

c#,datatable,oledb
Im reading excel sheet using oledbdatareader and convert to Datatable. So first few columns row in excel sheet tells information about the details of excel. Ex: Month ---- First Row Year --- Second Row Payment ---THird row Balance rows in that excel sheet have salary details of all employees. I...

C# Find non matching values in DataTables

c#,datatable,matching,relation
I'm struggling with the following problem: There are 2 DataTables (SSFE and FE in my case). FE will contain items that match with SSFE, but it will also contain values not present in SSFE. For Example SSFE 1,2,3,4,5,6,9,10 FE 1,2,3,4,5,6,7,8,9,10,11 The ouput I need is in this example : 7,...

Displaying all pages from the pagination of a datatable

javascript,jquery,datatable,pagination,jquery-datatables
I am using datatables JS with bootstrap, I am running into an issue where there is a wrokaround but it is not the nicest. The issue: my table contains more than 4k records If the person who is working on the table needs to work from record 200 to 300...

Join some rows in datatable

c#,datatable
i have this structure of datatable: TYPE CODE VALUE NAME ----------------------------- D 123 -4 example1 D 123 5 example1 R 123 1 example1 D 444 5 example2 R 777 -2 example3 I want to sum rows, where TYPE and CODE are the same. Result will should be: TYPE CODE VALUE...

Updating Pagination for polling with dataTables object

jquery,datatable
I am using the latest DataTables, however I have not updated my code to use the new API... I am still using the Hungarian notation! I don't mind if answers use the new methods and notation, but I just wanted to frame the context of the question. ;) I have...

Adding image to GridView created in CodeBehind

c#,asp.net,gridview,datatable
First thing I do is create a Datatable and then bind it to a GridView Here is my code DataTable dt = new DataTable(); DataColumn imgC = dt.Columns.Add("img", typeof(string)); DataRow row1 = dt.NewRow(); row1["img"] = "~images/foo.png"; GridView gv = new GridView(); gv.DataSource = dt; gv.DataBind(); cust_services.Controls.Add(gv); I'm not sure where...

pick a random records from a datatable

c#,random,datatable
I'm trying to create an application which import an excel file and read the data from it and it returns n records randomly as winners according to how many winners the user want from that list. so i read the data from excel file and assign it to a datatable...

Bulk Exporting Data from Codeignitor to CSV using Database Utility Class

php,database,codeigniter,datatable,codeigniter-2
Here is my code: function export_csv() { $st = $this->input->get('st'); //Start Date $en = $this->input->get('en'); //End Date $sTable = 'TABLE_NAME'; $this->load->dbutil(); $aColumns = array('tempdisplayid AS ucid','uui','campaign_name','location','caller_id','skill','calltime','answertime','TIMEDIFF(answertime,calltime) as...

How Can i Validate datatable's Data before inserting it using SqlBulkCopy

c#,asp.net,sql-server,datatable,sqlbulkcopy
I'm importing 3 thousands rows from Excel Sheet using ExcelDataReader to Datatable. How can i validate these rows before inserting them into database using SqlBulkCopy.Writetoserver(). Questions: 1. How to compare my datatable to the TableScheme of one of the SQL Server Tables. 2. Can i Validate FK Constraints and PK...

Select and updating data from datatable

c#,asp.net,datatable
I select data from my datatable, by using following code,but it throws an exception am not familiar with. "Index was outside the bounds of the array." tblRooms.Select(IDRoom = 4) This is the value of IDRoom in thetblroom but I don't know why it causes an error. foreach (DataRow dr in...

How to upload/import a file in the new R shiny version 0.12 using DT package

r,datatable,upload,shiny
I have just updated shiny to version 0.12 and started to use the DT package (finding it a bit difficult to use but have to do it anyway). Basically I am trying to upload or import a file. This is my server code: shinyServer(function(input, output, session) { datasetInput <- reactive({...

How to change the position of text “No data available in table” in datatables?

javascript,jquery,css,datatable,jquery-datatables
I need to change the position of the text which is coming from data-tables. is it possible to do ? When ever their is no data in table the text coming from data-table is "no data available in table and by default its position is left aligned. Now i need...

Best way to remove duplicates from DataTable depending on column values

c#,asp.net,linq,datatable
I have a DataSet which contains just one Table, so you could say I'm working with a DataTable here. The code you see below works, but I want to have the best and most efficient way to perform the task because I work with some data here. Basically, the data...

Missing Data after insert into my end sql table using Sql Bulk Copy

c#,sql-server-2008,datatable,console-application,sqlbulkcopy
I wrote an console application that extracts data from my access table then using sql bulk copy to an temp sql table then from the temp table loads it into main sql table. the application works as expected but it extracts 26624 rows from access table and when it does...

C# - SqlDataAdapter doesn't fill DataTable no matter what

c#,sql-server,datatable
So I'm trying to fill a DataTable with data from a MSSQL query, but for some reason it completely refuses to work and it's making me very annoyed. When I iterate through the results with a SqlDataReader and Read(), I get the results and even when I attempt to fill...

Why when I export from datatable to csv it's same sorts by another columns what I want

c#,sorting,csv,datatable
I want to export my DataTable to CSV. DataTable is sort by column "Czas", but when I export it then data in the output file is sort by "Nrkarty". There you have a fragments of my code: time1 = dateTimePicker1.Text.ToString() + dateTimePicker3.Text.ToString()+":00"; time2 = dateTimePicker2.Text.ToString() + dateTimePicker4.Text.ToString()+":59"; DataTable DT3 =...

datatable plugin not working

jquery,html,jquery-plugins,datatable
I am trying to use the DataTable plugin to add functionality to my html table. I followed the steps for installation and initialization from datatables.net, but it is not adding any functionality to my html page. I am wondering if it is because my table is formatted in a way...

filtering firstname and lastname using datatable.js

javascript,jquery,table,datatable,filtering
I have created a application with dataTable for filtering firstname and lastname, I am having a firstname and lastname text-field through which I would filter firstname and lastname. The filtering is working but the issue is that firstname and lastname filtering is doing from both the textfield, Actually I need...

How to add a checkbox to a GridView and select/deselect based on a SQL table row value

c#,html,asp.net,gridview,datatable
<asp:GridView ShowHeaderWhenEmpty="false" ID="gvSubTasks" runat="server" AutoGenerateColumns="false" ClientIDMode="Static"> <Columns> <asp:BoundField DataField="SN" HeaderText="SN" /> <asp:BoundField DataField="ST" HeaderText="ST" /> <%-- ADD ANOTHER COLUMN HERE WITH THE CHECKBOX --%> </Columns> </asp:GridView> code-behind: string strST = @"SELECT ,A345 'SN' ,M3w 'ST' ,A667 'CT' -- 0 for not complete and 1 for complete FROM [mydb].[dbo].[table1]"; public DataTable...

Looping trough rows in DataTable and extracting element in c#

c#,datatable,datarow
I want to extract items of the column in DataTable and put them in List. This are my List and DataTable: List<int> product1 = new List<int>(); DataTable table = this.IoC.Resolve<ISurveyResultsService>().GetProduct(studyYear, productName); I want to loop trough the DataTable and put elements in the list. I tryed like this: foreach (var...

Avoid onRowClick event when outputLink is clicked inside of RichFaces datatable

javascript,javascript-events,datatable,richfaces
How to avoid the call to onRowClick on the datatable on the column that has the outputlink (target to a new window)? <rich:dataTable id="dt" value="#{bean.cars} var="_car"> <a:support event="onRowClick" action="#{action.navigateToCarDetails(_car.id)}"/> <rich:column> <f:facet name="header">Select</f:facet> <a:commandLink onclick="Event.stop(event)" action="#{bean.toggleSelectedCar(_car.id)}" reRender="dt" ajaxSingle="true" limitToList="true"> <h:graphicImage...

java datatable server side issue

java,jquery,datatable,server-side
I am working on datable that populate the data from server side, issue i am facing is that it always give a alert box that shows DataTables warning: table id=firmtable - Requested unknown parameter '1' for row 0. For more information about this error, please see http://datatables.net/tn/4 i am unable...

Improve DataGridView rows managing

.net,vb.net,winforms,datagridview,datatable
SCENARIO I'm manually filling a DataGridView with a DataGridViewRow collection: I created the columns at design time in the GUI builder of Visual Studio. First column takes an Integer value, its a DataGridViewTextBoxColumn. Second column takes an Icon object, its a DataGridViewImageColumn. Third column takes a String value, its...

C# Get String From Data set Exception

c#,string,datatable,dataset
I searched already & it isn't the issue to read Dataset , The issue is i done same but it is not working I Am trying to get complete name from Datasset, when i try following String Receiver_name = rec_Ds.Tables[0].Rows[0][First_Name].ToString() + " " + rec_Ds.Tables[0].Rows[0][Last_Name].ToString(); it gives ArgumentNullException was unHandeled...

Placing Hyperlinks in DataGrid

c#,html,asp.net,datagrid,datatable
I am very statically trying to place hyperlinks into datagrid table rows. Because there are multiple datagrids on my page created by a repeater, not every datagrid (or column) requires a hyperlink. Currently I am doing this: foreach (DataRow row in tableCopy.Rows) { row[3] = "<a href:'" + row[3] +...

XPages. Hide column in DataTable

datatable,xpages,lotus-notes
I'm trying to hide a column in the dataTable, but not working. Hiding only header. In example I try hide first column. Domino 9.0.1. I was mistaken or is it a bug? I know about the "display: none" for the column, but I have a lot of data, and not...

Creating a sample data table with X, Y, Z axis (student, cours, score) to bind to grid

c#,sql,datatable
I am trying to create a data table to bind to a grid for demonstration purposes: X axis column: "StudentName" (string) Y axis column: "CourseName" (string) Z axis column: "Score" (double) The user has to be able to edit both the student names and the course names (so these will...

Ajax update of datatable from a modal after filtering

ajax,jsf,primefaces,datatable
My question is very similar to this: Ajax update doesn't work, when using filter on datatable (JSF, Primefaces). I have a dataTable with an "Open" button (a commandButton) for each entry/row in the table, on click of which, a dialog will open. I have a form in the dialog that...

Checkboxes will only work on current pagination page in jQuery datatables

javascript,php,jquery,checkbox,datatable
I am using jquery data table for listing my content which have checkbox selection and selected content post the data but in submitted form only current page data sent. My Data table code is: $('#select').dataTable( { "order": [[ 2, "desc" ]], "lengthMenu": [[50, -1], [50, "All"]], "columnDefs": [ { orderable:...

Stored Procedure for insert

sql-server,stored-procedures,datatable,syntax-error,sql-insert
I am taking a datatable as parameter in my stored procedure and I am trying to insert a few of its column in one of the database tables but I don't know the correct syntax. This is what I have tried ALTER PROCEDURE [dbo].[spInsertInvoice] @tblInvoice [TypeExcel] READONLY AS BEGIN SET...

How to remove datatable from dataset?

c#,asp.net,datatable,dataset
Aspx code: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchCustomer.aspx.cs" Inherits="WebApplication1.eyeofheaven.SearchCustomer" %> <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <link rel="stylesheet" type="text/css" href="StyleSheets/SearchCustomerStyle.css"> <link rel="stylesheet"...

Adding property in php datatable for google chart custom html tooltips

javascript,php,jquery,datatable,google-visualization
I am trying to create custom html tooltips in my google chart by adding them into the datatable, right now my datatable is being created in PHP like this: $datatable = array('cols' => array( array('type' => 'string', 'role' => 'domain', 'label' => 'Month'), array('type' => 'string', 'role' => 'tooltip'), array('type'...

Binding datatable values into a checkbox that's placed inside GridView

asp.net,gridview,datatable
I am binding a datatable to a GridView which has a checkbox in one of its fields. I have trouble getting the checkbox to be checked according to the datatable. This is what I have thus far: <asp:TemplateField HeaderText="Approved" SortExpression="Approved"> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("Approved").ToString() == "Y" ? true...

How to unhighlight row in dataviewgrid C#

c#,datagridview,datatable
I have created a dataviewgrid with different column. I have kept selection feature by which one can get selected row by a button click and prompt an error when the row is not selected on button click. I see that the first row in table is always selected. Is there...

Datatables shared parameters affected by sorting

jquery,sorting,datatable
I have a DataTable that can have N number of children DataTable(s) that can be added/removed/recreated at any time. I would like the children to share initialization parameters but it seems that DataTables affect the original data structure. When adding two children and sorting the first one, the second child...

Columns in DataTable Disappearing

c#,asp.net,datatable
I have a DataTable which has columns generated upon a page load. As I do not wish for this table to be re-created every time a postback occurs, I have it in a no-postback if statement. To wit: DataTable purchase_display_data = new DataTable(); protected void Page_Load(object sender, EventArgs e) {...

DataTable.Update Fails and Throws DBConcurrencyException

c#,datatable,sqlcommand,sqldataadapter,sqlcommandbuilder
I'm trying to take advantage of the DataTable.Update method to update a SQL data source. Below is the code for the method that performs the update. string connString = "SQL connection string...this works."; string sqlSelect = "SELECT Payment, Amount, Date, Month, StartDate, EndDate, FROM Payment"; private void updateDataSource(DataTable dt) {...

Datatable show/hide sorting/paging

.net,sorting,datatable,jquery-datatables,paging
I have a problem with datatables.net I want to show sorting/paging based on when the screnn width is over 700px and hide it when its under 700px. It works when i go from over 700px to under 700px but when i increase the width again the sorting/paging isnt showing again....

Convert DataTable into object[ , ] array with LINQ

c#,linq,datatable
I sincerely apologize if this has been asked before; maybe I am just blind and not finding it. Is it possible to convert a DataTable into an object[ , ] type array using LINQ? Using the following code I can convert it into object[][] but that's not what I need...

How can I selectall visible rows in an icefaces ace:datatable?

jsf,datatable,icefaces
It doesn't look like the ace:datatable component has a selectall/deselectall functionality...unless you shift+click on the table directly. I DON'T want to perform an ajax submit and modify the RowStateMap because: a) I'd rather not do any submits until the form submission b) RowStateMap.setAllSelected() selects ALL rows in the table regardless...

Splitting a Datatable based on Column value

c#,list,datatable
I have a datatable containing a Bool(bit) Column. a b ------ ------ 1 10 0 20 1 30 0 20 1 10 I wish to split this into 2 independently sortable datatables based on this value (column a) I've had a look and found an old question: Split a DataTable...

Combobox Datasource assign to Datatable

vb.net,combobox,casting,datatable
How to convert Datasource of a Combobox to Datatable in VB.net? I know how to assign datatable to combobox. In this case I need to do it opposite way. Like: dim dt as DataTable = combobox1.DataSource Is this possible?...

Shortest way to save DataTable to Textfile

c#,datatable,streamwriter
I just found a few answers for this, but found them all horribly long with lots of iterations, so I came up with my own solution: Convert table to string: string myTableAsString = String.Join(Environment.NewLine, myDataTable.Rows.Cast<DataRow>(). Select(r => r.ItemArray).ToArray(). Select(x => String.Join("\t", x.Cast<string>()))); Then simply save string to text file, for...

Jquery datatable group by two columns with expand and collapse

jquery,datatable,grouping
references: Two level grouping One level grouping with expand and collapse I want the datatable as in #1, but with the feature of #2 for both the levels, that is both levels can be expanded and collapsed. fiddle reference: jsfiddle.net/RgKPZ/488/ If there is any other similar plugin other than jquery...

Datatables for mutiple tables on one page having different td count each

javascript,jquery,datatable
applying datatable on each table using id but it only triggers for one table and give error in console. "Uncaught TypeError: Cannot set property 'nTf' of undefined" while i need to display it on every table . Using class cannot be applied because each table has different td's count ....

Datatables select and search filter

jquery,datatable
I am using data table from here. I have implemented column wise select filter. I would like to implement a mixed of select and search filter for my table. In other words, say I have 3 rows : No, Name, Address. The No column should have a search filter. The...

How to read data from Excel starting from given row and getting proper type inference

.net,excel,datatable,ado,type-inference
I am importing data from .xls and .xlsx files using these connection strings "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\file.xls;Extended Properties="Excel 8.0;HDR=YES;IMEX=0;MaxScanRows=16;Empty Text Mode=NullAsEmpty;" or "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\file.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=0;MaxScanRows=16;Empty Text Mode=NullAsEmpty;" I load data in a datatable. Using connection As New OleDbConnection(connString) connection.Open() wsName = "myWorksheet$" Dim SQL As [String] =...

highcharts datatable - function parameters

javascript,highcharts,datatable
I want to display a datatable below my highcharts graphs. I found on the Highcharts FAQ a running example. Highcharts.drawTable = function() {...} I need to display many datatables, so i want to refactor my code in order to be able to give display parameters to the Highcharts.drawTable function. (this...

How to count the entire number of rows in a datatable

javascript,jquery,datatable
I am using a datatable for my application ,my need is that i want the total count of the rows in the datatable onload .How to get that .Here i my code i am posting $(document).ready( function() { $('#jobSearchResultTable').dataTable({ responsive: true, "scrollY": 500, "scrollCollapse": true, "jQueryUI": true, "aaSorting": [] });...

IDataReader vs DataTable; pros and cons

c#,datatable,sqlbulkcopy,idatareader
I am working on doing a large scale insert/update operation. So I am using SqlBulkCopy. SqlConnection myConnection = new SqlConnection(myConnectionString); try { myConnection.Open(); SqlBulkCopy myCommand = new SqlBulkCopy(myConnection); myCommand.DestinationTableName = "myDestinationTableName"; //Below method has four overloads; //of which I am interested in the two mentioned below. myCommand.WriteToServer(); myCommand.Close(); } finally...

There is no row in position 1 but in debug mode it is correctly mapped

c#,asp.net,datatable,datarow
I am trying to fill a DataTable using a parameter from a TextBox. Then I want to take the values from the DataTable and fill the rest of the text boxes on the WebForm. As of now I am testing it so I only want two TextBoxes to get filled...

Change the sequens of columns in datatable with linq

vb.net,linq,datatable,dataset
I have a Datatable with the columns Name|Age|Job I query that Datatable with Linq and do some manipulations. Dim query = From row in dt.AsEnumerable.where(...) The returned object is a datatable that I need for further procedures. But now I have to change the column sequence to Age|Name|Job and do...

spring mvc- primefaces: pagination does not working

spring,jsf,primefaces,datatable,bootstrap
I use Spring and primefaces. I have manageBean:{ @ManagedBean @RequestScoped public class OrderListView implements Serializable{ private static Logger LOG = Logger.getLogger(OrderListView.class.getName()); private List<Project> projects; public void setForums(List<Forum> forums) { this.forums = forums; } @PostConstruct public void init() { System.out.println("A new backing bean has been created"); projects = new ArrayList<Project>(); projects.add(new...

Primefaces datatable duplicate “No records found” while doing column freeze for empty records

jsf,jsf-2,primefaces,datatable
I am using primefaces <p:datatable> to freeze some of my columns.Everything is fine but when there are no records in then it gives two "No records found" message.This is weird situation.Do anyone have come across this problem? Suggestions are welcome.I want only one "No records found " message. <p:dataTable var="car"...

JavaScript: Add table values to input field on button click

javascript,input,data,datatable
I have a DataTable that stores names only. I want to have a button that will add all the names in the DataTable to an text input field. <div id="myTabDiv"> <table name="mytab" id="mytab1"> <thead> <tr> <th>name</th> </tr> </thead> <tbody> <tr> <td>chris</td> </tr> <tr> <td>mike</td> </tr> </tbody> </table> <button id="add" >ADD</button>...

Return DataTable from ORACLE

oracle,datatable,nothing
I'm trying to get data from Oracle to a Datatable. My idea was to create a function to do all connection staff and then call it from other parts of the code. Like: dt = New DataTable dt = Oracle2table(sql.ToString) Then, I created the function: Function Oracle2table(ByVal sql As String)...

DataTable does not release memory

c#,memory,memory-management,datatable
I have a data loading process that load a big amount of data into DataTable then do some data process, but every time when the job finished the DataLoader.exe(32bit, has a 1.5G memory limit) does not release all the memory being used. I tried 3 ways to release memory: DataTable.Clear()...

dataTable doesn't show list [duplicate]

postgresql,jsf,datatable
This question already has an answer here: When should I load the collection from database for h:dataTable 1 answer I'm trying to render a list of products in a .xhtml page, from my database in Postgres: i'm using the JSF tag h:dataTable. Unfortunately, when I display the page, I...

With JQuery Datatable, how do you get the search/entries etc to be on the same line

jquery,css,datatable
I have copied an example from the datatable site which should put some of the controlling items on the same physical line. However for some reason they are appearing on separate physical lines. This is taking up too much of the screen space. see below I have the following script...

Error occurred while convert the dataTable to excel. [duplicate]

excel,jsf,primefaces,datatable
This question already has an answer here: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/RichTextString at org.primefaces.component.export.ExporterFactory.getExporterForType 2 answers I got these error message while click the export button in the sever. I can't convert that table. I used primeface 5.0 and netbeans 8.0.2 version and GlassFish server 4.1 How can i solve this problem?...

Primeface Datatable filtering removed when sorting with o:form includeRequestParams=“true”

primefaces,filter,datatable,omnifaces,http-request-parameters
this is an issue following this one: Primeface datatable.filter() and url parameter is use PrimeFaces-5.1 and omnifaces-2.1 to render a datatable with pagination, filtering and sorting while using request parameters. my datatable is constructed like this: <o:form includeRequestParams="true"> <p:dataTable id="hostStateHistoryTable" value="#{HostHistoryBean.hostStateHistoryList}" var="status" widgetVar="statusTable" filteredValue="#{HostHistoryBean.filteredHostStateHistoryList}" rowStyleClass="#{status.state eq 0 ? 'up' :...

dataTables custom filtering of if class list contains a class

jquery,filter,datatable,datatables
How can I filter datatable rows by class when the row has multiple classes. I need for the row to appear in any instance when the class list contains the class I filter for. <tr class="gradeA">...</tr> <tr class="gradeA gradeC">...</tr> <tr class="gradeC">...</tr> The row with "gradeA gradeC" should appear in both...

ignoring jquery plugin datatables empty rows on post action to database with laravel 5

php,laravel,datatable
I have a laravel 5 app with jQuery datatables with 3 inputs in each table row. When I post them to be inserted the database I want to check that in each row at least 2 of the inputs are filled in before inserting. If at least two rows are...

How to display data into tag using datatable?c#,asp.net,datatable,code-behind
Hello I am doing web project in VS express for web and I am quite new to c# programming and simply adjusting the syntax and format of it. I was just wandering how do you display the data in a datatable and display it in the table web page when...

Categorizing a hash of arrays into a datatable. rails

ruby-on-rails,ruby,ruby-on-rails-4,datatable
I'm not sure how to go about categorizing a hash of arrays. My hash would look something like this: {"Level 1" => [foo, bar], "Level 2" => [foo, bar, foobar]} I want to be able to display the hash key in a row, and then place the objects of that...

JQuery 1.4.4 and Datatable 1.7 not working

javascript,jquery,json,xml,datatable
I needed some help with datatables. I might be missing something here:- Below is my HTML <div id="cfcPhoneDirectory"> <table id="dynamicPhoneDirectory"> <thead> <tr><th>Phone Book</th><th>Last Name</th><th>First Name</th><th>Number</th></tr> </thead> </table> And the Script var rawxmlData =...

adjust the rows dynamically in paginator of primefaces datatable

primefaces,datatable
I am using the primefaces datatable paginator. I have fixed the to no of rows to 15. This correctly matches the my system resolution. But users are using monitors with different(bigger) resolutions. The no of rows in this case will be less and space will be displayed at the bottom....

JQuery Datatable Error “Cannot read property 'length' of undefined”

php,jquery,ajax,datatable
I am getting data for my DataTable from another URL on my website called request.php. request.php: $con = mysql_connect("xxxx", "xxxx", "xxxx"); $con or die(mysql_error()); mysql_select_db("xxxx") or die(mysql_error()); $result = mysql_query("SELECT * FROM users_logins") or die(mysql_error()); $resultArray = array(); $tempArray = array(); while($row = mysql_fetch_assoc($result)) { // Add each row into...

DataTable Modifies Date Format - WHY?

c#,sql,asp.net,sql-server,datatable
So I issue a test query like SELECT * from my table with a start_date column that has a Date data type. This query is then made into a DataTable, after which it's converted to a CSV file. In SSMS, the query returns only the date, as you can see...

Access particular row of p:datatable in Backing Bean on click of h:CommandLink without binding attribute

jsf,jsf-2,primefaces,datatable
Please find my code below for p:datatable having h:commandlink as one of its column: <p:dataTable id="listTable" value="#{listBean.lazyDatalist}" var="list" paginator="true" paginatorPosition="top" rows="10" rowIndexVar="rowIndex" rowStyleClass="#{(rowIndex mod 2) eq 0 ? 'rowStyleOdd' : 'rowStyleEven'}" lazy="true"> <p:ajax event="page" listener="#{listBean.searchLazyData}"/> <p:column style="width:3%;" headerText="#{msg['userlist.dt.srNo']}"> <h:outputText value="#{list.orderCount}"></h:outputText>...

Primefaces datatable combine data in only one row

jsf,primefaces,datatable
I am using tomcat8 and primefaces 5.1 and I have the following code: <p:dataTable var="price" value="#{HOTEL.hotel}"> <p:column headerText="Тип стая"> <h:outputText value="Единична" /> <h:outputText value="Двойна" /> <h:outputText value="Апартамент" /> <h:outputText value="Студио" /> </p:column> <p:column headerText="Брой"> <h:outputText value="#{HOTEL.hotel.room_1}" /> <h:outputText value="#{HOTEL.hotel.room_2}" /> <h:outputText...

NullReferenceException on DataRow C# [duplicate]

c#,datatable,datarow
This question already has an answer here: What is a NullReferenceException and how do I fix it? 17 answers My problem is about an object not set to an instance after the first line inside the foreach loop. I really had a hard time thinking what should be instantiated...

jsf - foreign key in datatable

jpa,datatable
I'm showing a list of Orders in a datatable , and one of its columns must show the customer_id of that order: customer_id is a fk in ManyToOne relationship. Customer entity @Entity public class Customer { ///other columns @OneToMany(mappedBy = "cliente", fetch=FetchType.EAGER) private List<Order> orders; Order entity @Entity @Table(name =...

Desired page in pagination with DataTables

datatable,pagination,datatables,jquery-datatables,datatables-1.10
I am using datatables plugin on my table. I am getting pagination with prev..next..and all page numbers. But my requirement is I need to have a textbox in which I can enter the number, which will take to the entered page number. I am using plugin from here::https://www.datatables.net/ here is...

Datatable link stops working after page one

javascript,php,jquery,mysql,datatable
I have a datatable with a data-href inside to create a link to a forum page, My issue lies in the place that my datatable link works great on page one, but when I go to page two I can no longer follow the link,but it still has all the...

DataTable.js implement a filter to hide rows by index

javascript,jquery,datatable,jquery-datatables
I created this filter to compare the index of the row to starttime and endtime variables. The idea is that the values of starttime and endtime correspond to the rows in the table. $(document).ready(function () { var startTime = 0; var endTime = 23; $.fn.dataTableExt.afnFiltering.push( function (oSettings, aData, iDataIndex) {...

Is it possible to define a column type in DataTable at run time?

c#,datatable,system.data,system.data.datatable
I would like to create a DataTable but I don't know the types of columns at compile time. Therefore, I would like the columns types to be decided at run-time. WHAT I'VE TRIED: First, I get some data from Excel: Type tempCheck = (dynamic)(xlRange.Cells[1, currentColumnsCount] as Excel.Range).Value2.GetType(); Then I try...

Export DataTable to CSV File with “|” Delimiter

c#,asp.net,csv,datatable,export
I am building an ASP.NET C# project that has a functionality to export DataTables to CSV files with a | delimiter for each cell. I want it to look like this: 100001|06/19/1861|Jose|Rizal|Filipino|Calamba, Laguna| 100002|08/30/1850|Marcelo|Del Pilar|Filipino|| 100003|||||| As you can see, each 'cell' is delimited by |. Furthermore, null cells should...

Don't split the string if contains in double marks

c#,datatable
I have a text delimeted file need to convert into datatable. Given the text something like this : Name,Contact,Email,Date Of Birth,Address JOHN,01212121,[email protected],1/12/1987,"mawar rd, shah alam, selangor" JACKSON,01223323,[email protected],1/4/1967,"neelofa rd, sepang, selangor" DAVID,0151212,[email protected],3/5/1956,"nora danish rd, klang, selangor" And this is how i read the text file in C# DataTable table = new...

Binding a datagrid template column (as datepicker column) to a datatable column

c#,wpf,data-binding,datatable,datagridcolumn
I am building a database-access program that dynamically creates datagrid columns, as well as dynamically requests data based on account preferences. I have several datagrids that work in identical manners and for the most part they work perfectly. All of my text columns bind to the datatables that I use...

binding on p:dataTable which is included multiple times causes ID unqiueness exceptions

jsf-2,primefaces,binding,datatable,facelets
I'm attempting to use a special PrimeFaces data exporter implementation as being used in this answer: http://stackoverflow.com/a/14413932/396732 Our use case however is a little more complex, e.g. using Facelets to show the respective datatable for export, which has row expansions with sub tables in them. insiderListManagerDialogs.xhtml: <ui:include src="insiderListManagerListDialog.xhtml"> <ui:param name="idPrefix"...

Get p:dataTable row data via p:selectOneMenu

jsf-2,primefaces,datatable,row,selectonemenu
I have a dataTable which one of the columns contains a selectOneMenu (a.k.a dropDownList). Basically each row has a selectOneMenu which has a list of values. Is there a posibility to pass the row data or key whenever the selectOneMenu value has been selected? This way I can loop through...

How to append datatable to existing records in CSV file

powershell,csv,datatable
I have CSV file MyFile.csv. It contains following data: RollNumber Name 1 Amol 2 Ravi Now I am fetching few records from SQL Server as follows: RollNumber Name 3 Viku 4 Vaibhav I am not able to find a way to append these new records to existing CSV file. I...

Minimum and maximum data form Data Table

c#,datatable
I have data Table with four columns: Date, isin, Price and State. I need to get minimum and maximum date from the Date column. I'm using this code and it works fine with one file however with other file it shows me wrong maximum date. DateTime stDate = Convert.ToDateTime((excleTable.Compute("min(date)", string.Empty)));...

Add Column to DataTable before exporting to Excel file

vb.net,excel,datatable,type-conversion,dataview
I have a DataTable that is built like this: Dim dt As New DataTable() dt = SqlHelper.ExecuteDataset(connString, "storedProcedure", Session("Member"), DBNull.Value, DBNull.Value).Tables(0) Then it is converted to a DataView and exported to Excel like this: Dim dv As New DataView() dv = dt.DefaultView Export.CreateExcelFile(dv, strFileName) I want to add another column...