datatable

What is the fastest/best optimized way to bind hierarchal data(Chart of Account) to a treeview?

For a Chart of Account, has the following structure, ID AccountName ParentID 1 Income - 2 Expense - 3 Assets - 4 Liabilities - 5 Current Assets 3 6 Fixed Assest 3 7 Cars 6 8 Treasury 7 9 Banks 8 10 National Bank 9 11 Customers 5 12 Ahmed 11 13 ...

dataTable JSF Dynamic Scrollable

I was wondering, How do I make a dynamic scrollable datatable. For eg: Scroll bar should be visible after 15 records. I have a requestRowAction attached in each row, so, clicking the row should not change the scroll bar position. Any help would be greately appreciated. ...

ASP.net DataTable doesn't store new rows.

In my simple starter asp page I create a DataTable and populate it with two rows. The web site allows users to add new rows. My problem is the DataTable doesn't save the information. I've stepped through the code and the row gets added but the next time a row is added it's not there, only the original two and the newest one to get entere...

how to serialize a DataTable to json or xml

Hello, i'm trying to serialize DataTable to Json or XML. is it possibly and how? any tutorials and ideas, please. For example a have a sql table: CREATE TABLE [dbo].[dictTable]( [keyValue] [int] IDENTITY(1,1) NOT NULL, [valueValue] [int] NULL, CONSTRAINT [Psd2Id] PRIMARY KEY CLUSTERED ( [keyValue] ASC )WITH (PAD_INDEX ...

Filter DataTable to show only the most recent transaction for each user

I have a datatable that contains rows of transaction data for multiple users. Each row includes UserID and UserTransactionID columns. What would I use for as a RowFilter in the tables DefaultView to only show the row for each user that has the highest UserTransactionID value? sample data and results UserID UserTransactionID PassesFi...

Problem with MultiColumn Primary Key

DataTable NetPurch = new DataTable(); DataColumn[] Acct_n_Prod = new DataColumn[2]; DataColumn Account; Account = new DataColumn(); Account.DataType = typeof(string); Account.ColumnName = "Acct"; DataColumn Product; Product = new DataColumn(); Product.DataType = typeof(string); Product.ColumnName = "Prod"; NetPurch.Columns.Add(Accoun...

Rich faces and dataTable

I have the question regarding rich faces and beans. I have a jsp page that is using richfaces and inside it I have the: rich:extendedDatatable component, that takes data from my MainBean as ArrayList (this bean queries the mySQL and puts results to the ArrayList that populates the dataTable later on). There are 4 columns in datatable, fi...

a4j:jsFunction with actionListener inside of h:dataTable

Hello all, I'm having problem with using a4j:jsFunction with actionListener inside of h:dataTable, when I want to invoke an action over particular row with a4j:commandLink it works flawless but when I want to invoke the action with a4j:jsFunction & actionListener it's always invoked over the last element in dataTable Let me give you an e...

How to insert a DataTable with existing Key to a SQL Server Table.

I am working with VB.NET.. i have a DataTable called "QUESTION", containing 3 fields: QuestionNumber (unique integer key) QuestionText QuestionType In my SQL Server database I created a Table called "QUESTION" with the same fields. QuestionNumber is defined as integer unique key, auto increment Now, when i make a bulk copy to inser...

How to definie a VB.NET DataTable Column as primary key after creation

Hello I am importing Tables from a Oracle DataBase, using a VB.NET dataAdapter. I use the "fill" comand to add the imported data to a DataSet. How is it possible to define a specific column of a DataTable as PrimaryKey, after the DataTable is already filled with data? Thank your for your help. ...

Problem in creating different types of columns in a Winforms gridview

My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for fu...

ASP.NET troubles with updating DataGrid binded to custom DataTable

I bind custom DataTable to DataGrid through ObjectDataSource, where i use SelectMethod and UpdateMethod. SelectMethod working great, but when I try to update row it's breaking by MissingMethodException. What should i do to fix this problem? Sorry for my bad english ;) ...

C# and NpgsqlDataAdapter returning a single string instead of a data table

I have a postgresql db and a C# application to access it. I'm having a strange error with values I return from a NpgsqlDataAdapter.Fill command into a DataSet. I've got this code: NpgsqlCommand n = new NpgsqlCommand(); n.Connection = connector; // a class member NpgsqlConnection DataSet ds = new DataSet(); DataTable dt = new DataTabl...

How I can export a datatable to MS word 2007, excel 2007,csv from asp.net?

Hi, I am using the below code to Export DataTable to MS Word,Excel,CSV format & it's working fine. But problem is that this code export to MS Word 2003,Excel 2003 version. I need to Export my DataTable to Word 2007,Excel 2007,CSV because I am supposed to handle more than 100,000 records at a time and as we know Excel 2003 supports for o...

C# : Filtering data of data table using select method

I have data table containing one column as FilePath. FilePath D:\New folder\link.txt D:\New folder\SharepointMigration(Work Schedule).xls D:\New folder\my2\link.txt D:\New folder\my2\SharepointMigration(Work Schedule).xls D:\New folder\my2\my3\New Text Document.txt D:\New folder\Try.txt I am filtering my data table b...

Grails' gui datatable exception

HI I'm using gui's datatable in grails, but when I try to run the code, I get this exception: org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: org.grails.grailsui.ResourcesTagLibService.stylesheetTag() is applicable for argument types: (java.lang.String, java.lang.String...

Can I use Linq to project a new typed datarow?

I currently have a csv file that I'm parsing with an example from here: http://alexreg.wordpress.com/2009/05/03/strongly-typed-csv-reader-in-c/ I then want to loop the records and insert them using a typed dataset xsd to an Oracle database. It's not that difficult, something like: foreach (var csvItem in csvfile) { DataSet.MYTABLED...

How can I transform a DataTable in a group-by date DataTable with LINQ?

I have a untyped DataTable that looks like this (srcTbl): date col_1 col_2 ... col_n 1.3.2010 00:00 12.5 0 ... 100 1.3.2010 01:00 0 0 ... 100 1.3.2010 22:00 0 0 ... 100 1.3.2010 23:00 12.5 0 ... 100 ... 31.3.2010 00:00 2 0 ... 100 31.3.2010 01:00 2 0 ... 2...

Iterate through a DataTable to find elements in a List object?

As I iterate through a DataTable object, I need to check each of its DataRow objects against the items in a generic string List. I found a blog post using the List's Find method along with a delegate, but whereas that example has a separate class (Person), I'm attempting something like the following using an instance of the string objec...

WPF C# Gridview to datatable

Hi! I have a gridview into a listview and what I want is to convert gridview to a temporal datatable including column headers. How can I do this? Thanks. ...