datatable

DataTable Pivot method with composite key field

I need a C# method that can pivot a DataTable/IDataReader object where the source table contains a composite key. I wanted to use this: http://weblogs.sqlteam.com/jeffs/articles/5091.aspx however it only works for a single key column. No SQL, it must be C#. ...

sqlbulkcopy mem. management

I'm using SQLBULKCOPY to copy some data-tables into a database table, however, because the size of the files I'm copying run sometimes in excess of 600mb, I keep running out of memory. I'm hoping to get some advice about managing the table size before I commit it to the database so I can free up some memory to continue writing. Here ar...

DataTable Sorting

Initial DataTable values Group Col2 ====== ==== null 21 G 22 null 23 G 30 G 31 I want to order the Datatable so that it has : Group Col2 ====== ==== null 21 G 22 G 30 G 31 null 23 basically since value 22 has Group 'G' , all the rows in the same group are immediately after 22. Is th...

Convert DataTable to IEnumerable<T>

I am trying to convert a DataTable to an IEnumerable. Where T is a custom type I created. I know I can do it by creating a List but I was think there was a slicker way to do it using IEnumerable. Here is what I have now. private IEnumerable<TankReading> ConvertToTankReadings(DataTable dataTable) { var tankReadings = n...

How to write every time to a new row of data table?

How can i insert each time a diffrent row in datatable? The data table is used in a dataGridView to write a log. I need each time to write in a diffrent line (row) in the datatable, when I can't know how many rows I need in runtime. Another thing; the datatable is loaded from a XML file, so there might be already rows in the data table. ...

Is it possible to list pages (DataTable paginator="true") with TreeTable? and filterBy in collumn with TreeTable?

I'm new to prime faces and wanted to see if they could use in some way, the paging DataTable (paginator = "true") in TreeTable and filterBy(p: column filterBy = "# MyBackingBea.name") in TreeTable also. The last before mentioned, (filterBy) only worked in DataTable not in TreeTable. The code: <p:treeTable value="#{documentsControl...

Problem in updating page wise total in JSF datatable when using RichFaces datascroller

I am creating a datatable in my JSF page which shows the footer for every column with the total of values in the column page wise. I am using Richfaces datascroller for paging. When I click next page in richfaces datascroller I need to update my footer with the total of column values in that page, which now a problem for me I managed ...

Wait message for slow JSF page

I have a jsf page having a request scope bean. A slow database query is fired in the constructor of the request scope bean. Then, the results of the query are shown in a jsf data table on the web page. How do I display a wait message until the database query completes? I tried calling a javascript function for onLoad of tag. The metho...

Event link between Jquery Datatable cell and Google Maps marker ?

Hi, I have to make a link in a Jquery Datatable cell (http://www.datatables.net/) and a marker on Google Maps V3. An exemple without Jquery Datatable is available there : http://code.google.com/p/gmaps-samples-v3/source/browse/trunk/sidebar/random-markers.html?r=142 Any idea ? Thanks in advance ! ...

Append text to existing row in datatable

I'm trying to make a calendar in vb.net and I have come across this problem. I want to append some text into an existing datatable row. When I watch my debugger it says:"In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.". Dim aantalRijen As Integer = 1 ...

Adding a Byte[] to a datarow

I'm trying to write a test that returns a data-reader with one of the columns being a byte[]. I figured I can create a datatable and create a reader from that. var cboTable = new DataTable("CBOTable"); var colValue = new SqlBinary(ASCII.GetBytes("Hello This is test")); cboTable.Columns.Add("ByteArrayColumn"); cboTable.Rows.Add(colValu...

IEnumerable to string

Hi. I have a DataTable that returns IDs ,1 ,2 ,3 ,4 ,5 ,100 ,101 I want to convert this to single string value, i.e: ,1,2,3,4,5,100,101 How can i rewrite the following to get a single string var _values = _tbl.AsEnumerable().Select(x => x); ...

Good way to format data in a large DataTable

I have a large data.DataTable and some formatting rules to apply. I'm sure this is not a unique problem. For example, the LASTNAME column has a value of "Jones" but my formatting rule requires it be 10 characters padded with spaces on the right and uppercase only. Like: "JONES " My initial thought is to loop through each row and...

Render jsf data table as it is populated with data

I have a data table with binded to a large list. I want to render the data table as that list is fetched, instead of waiting for the entire list to be fetched. Is this possible? ...

Data Structure To Store Arbitrary Database Tables

Hello, I'd like to design a JVM data structure (Java/Scala) that can be used to represent and store the contents of arbitrary relational database tables. The data structure should be fast (not too gc-intensive, cache-friendly) and memory efficient, so larger tables can fit in RAM. One memory-efficient solution is to store each column ...

Performance issue on the update of a DataTable bound to a Datagridview

I have a dataTable bound to a DatagrindView and would like to update a selected column. My DataTable(displayDT) and my datagridview1 have the same layout: DateTime item1 item2 item3 1/1/2010 100 100 100 1/1/2010 1:00 120 110...

how to write data more than one excel sheet

hi, i have 3 datatables .i need to write these three datatable data in an excel sheet. as we know that under one excel sheet i can have (more than 1 sheet). in a same way i need to write my 3 datatable data into one excel(where sheet1 will conatin dattable1,sheet2 will conatin dattable2,sheet3 will conatin dattable3) this is the...

i need fast and convenient way to organize table data in-memory

Initial conditions: DateTime moment string key double value somewhere across the code i want to Add("2010.08.09 12:55:34", "px_ValX", 10); Add("2010.08.09 12:55:35", "px_ValX", 1); Add("2010.08.09 12:55:35", "px_ValY", 12); Add("2010.08.09 12:55:35", "px_ValZ", 100); Add("2010.08.09 12:55:38", "px_ValZ", 5); and then i want to ...

Converting all the DateTime Columns to SqlDateTime Columns in a Datatable

Hi, What I want to do is basically take any generic DataTable and then Convert all the DateTime columns into SqlDateTime Columns. (i.e if the datetime column value = datetime.MinValue then Set it to SqlDateTime.Null) Is there anyway I can do this without altering the original datatable (i.e withoutadding computed columns ) or having t...

Avoid field Repetition in data list

I had datalist which bind medthod which Retrieve data from data base and I had field called (Option) and other called (Value) and any Option had more values .and I could Retrieve these data well but all values under them and also options as. Option1 Option2 Option3 Value1 Value2 Value3 And the result must be Opti...