datatable

How can I synchronise two datatables and update the target in the database?

I am trying to synchronise two tables between two databases. I thought that the best way to do this would be to use the DataTable.Merge method. This seems to pick up the changes, but nothing ever gets committed to the database. So far I have: string tableName = "[Table_1]"; string sql = "select * from " + tableName; ...

What is the correct date format for a Date column in YUI DataTable ?

I have produced a data table. All the columns are sortable. It has a date in one column which I formatted dd/mm/yyyy hh:mm:ss . This is different from the default format as defined in the doco, but I should be able to define my own format for non-american formats. (See below) The DataTable class provides a set of built-in static fu...

ListBox Items Not Visible after DataBinding

Hello All, I am writing a page that allows users to search a parts table, select quantities and a listbox is to be populated with gridview values. Here's a snippet of my aspx page: <asp:ListBox runat="server" ID="lbItems" Width="155px"> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> <asp:List...

Failed to convert parameter value from a Guid to a String

Hello, I am at the end of my knowledge and googled for the answer too but no luck :/ Week ago everything worked well. I did a revert on the repository, recreated the tableadapter etc... nothing helped. When I try to save in my application I get an SystemInvalidCastException at this point: PersonListDataSet.cs: partial class P_Group...

Binding WPF DataGrid to DataTable using TemplateColumns

I have tried everything and got nowhere so I'm hoping someone can give me the aha moment. I simply cannot get the binding to pull the data in the datagrid successfully. I have a DataTable that contains multiple columns with of MyDataType} public class MyData { string nameData {get;set;} boolean showData {get;set;} } MyDataTyp...

sort arrow is always showing up once sorting is used

We have several pages as tabs where datatable is used in most of the pages. When we sort on a particular coulmn and exit the page and re enter this page the arrow appears (up/down depending on how we exit the page). But the data is not sorted in the direction the arrow shows. I have set preserveSort and preserveDataModel to false. The ar...

Richfaces: rich:datatable rowspan using rich:subtable

Hi, I use Richfaces, Seam and JSF, and I want something like the following: and I have managed it to a degree using a rich:subtable like this: <rich:dataTable value="#{backingBean.companyList}" rows="100" var="company"> <f:facet name="header"> <rich:columnGroup> <rich:column>Company Name</rich:column> <rich:colum...

Is there a way to populate an strongly typed object when the structure isn't known?

i'd like to be able to query any number of databases with different table layouts, return a datatable then use that datatable to build a strongly typed object. Is there anything out there that does this or comes close without having to code for each different table layout? Thank you in advance! Zac ...

Populating and Using Dynamic Classes in C#/.NET 4.0

In our application we're considering using dynamically generated classes to hold a lot of our data. The reason for doing this is that we have customers with tables that have different structures. So you could have a customer table called "DOG" (just making this up) that contains the columns "DOGID", "DOGNAME", "DOGTYPE", etc. Customer...

jquery google visual api graph's data rows does not work.

Hi! I'd like to use google drawVisualization API. Example: var data = new google.visualization.DataTable(); data.addColumn('string'); data.addColumn('number'); data.addRows([ ['a', 14], ['b', 47], ['c', 80], ['d', 55], ['e', 16], ['f', 90], ['g', 29], ['h', 23], ['i', 58], ['j', 48] ]); ...

DataTable C# Empty column type

I am trying build a DataTable one row at a time using the following code. foreach (var e in Project.ProjectElements[hi.FakeName].Root.Elements()) { index = 0; object[] obj=new object[count]; foreach (var holdingColumn in names) { string d = e.Attribute(holdingColumn.Key).Value; ...

DataTable does not merge user defined objects

I got a problem with a DataTable handling an object defined by myself (Position). The object stores some data and overwrites ToString, Equals and GetHashCode. Further it provides the static operators for == and !=. The DataTable works fine as long the column storing this object is not a key column. Setting it as a PrimaryKey and merge a...

Accessing deleted rows from a DataTable

Hello: I have a parent WinForm that has a MyDataTable _dt as a member. The MyDataTable type was created in the "typed dataset" designer tool in Visual Studio 2005 (MyDataTable inherits from DataTable) _dt gets populated from a db via ADO.NET. Based on changes from user interaction in the form, I delete a row from the table like so: ...

Class design when working with dataset

If you have to retrieve data from a database and bring this dataset to the client, and then allow the user to manipulate the data in various ways before updating the database again, what is a good class design for this if the data tables will not have a 1:1 relationship with the class objects? Here are some I came up with: Just manipu...

java.util.Map with HtmlDataTable

Hi, I'm developing an application on GlassFish v3 which uses Suns-RI of JavaEE6 and JSF2.0, etc. And the bad thing is, that no changes/switches away from Suns RI can be made (to use MyFaces or something like that). Now, the problem is, that I want to build HtmlDatatable by hand ( in Java code). The datatable should represent a jav...

Need help for a complex linq query

Ok so I've got a DataTable here's the schema DataTable dt = new DataTable(); dt.Columns.Add("word", typeof(string)); dt.Columns.Add("pronunciation", typeof(string)); The table is filled already and I'm trying to make a linq query so that i can output to the console or anywhere something like : Pronunciation...

How do I display a Wicket Datatable, sorted by a specific column by default?

Hello everyone! I have a question regarding Wicket's Datatable. I am currently using DataTable to display a few columns of data. My table is set up as follows: DataTable<Column> dataTable = new DataTable<Column>("columnsTable", columns, provider, maxRowsPerPage) { @Override protected Item<Column> newRowItem(St...

C# Bind DataTable to Existing DataGridView Column Definitions

I've been struggling with a NullReferenceException and hope someone here will be able to point me in the right direction. I'm trying to create and populate a DataTable and then show the results in a DataGridView control. The basic code follows, and Execution stops with a NullReferenceException at the point where I invoke the new UpdateRe...

OdbcConnection for a string in a csv

I've got some code below that would allow me to access a .csv file on the server and pull the contents into a datatable which enables me to iterate the rows easily. For somethine completely seperate I have the contents of a csv in a string variable and I'd like to be able to pull that string into a datatable also. How can I do this witho...

How do you filter a view of a DataTable in .Net 3.5 sp1 using WPF c# and xaml?

I found the MSDN example code for getting the default view of a collection and adding a filter to the view, but most of it is for .Net 4.0. I'm on a team that is not currently switching to 4.0, so I don't have that option. None of the examples I found used a DataTable as the source, so I had to adapt it a little. I'm using a DataTable...