datatable

Auto-populating a DataTable column

How do you fill out a particular column of a DataTable (say, a uniqueidentifier) on creation of a row so that you can always assume that column is going to have a useful value? I've got this column bound to a property on an object of mine with NullValue = Guid.NewGuid() but it requires FormattingEnabled and so I suspect that this i...

Bind or Pull a DataTable record to a MessageBox Text in C#

I am trying to make a messagebox text provide datatable results. Below is a snippet of code that I have written so far: String mystring = comboBox1.Text; if (mystring.Substring(0, 12) == ("Company Name")) { textBox2.Text = mystring.Substring(13); ADOCon.ConnectionString = @"Provid...

Inserting Values into Datatables

Hi, I have a DataTable populated with values from a database. I have another datatable that I am creating which has the same column names from the first, pluse some extra data that I need for creating a CSV down the line. What I would like to do is take the data from the first table and use it to populate the second table, then later ...

Should I Dispose() DataSet and DataTable?

DataSet and DataTable both implement IDisposable, so, by conventional best practices, I should call their Dispose() methods. However, from what I've read so far, DataSet and DataTable don't actually have any unmanaged resources, so Dispose() doesn't actually do much. Plus, I can't just use using(DataSet myDataSet...) because DataSet ha...

Searching A Gridview With A DataTable Datasource

Hi I have a gridview that gets its data from a webservice. This comes into the application in a dataset. Me.GvStreets.DataSource = TheWebServiceSearch.AddressDataTable Me.GvStreets.DataBind() Once in the grid view how do I search the contents of this dataset. Do I have to add it to some sort of datasource control like...

Can you use DataTable.Contains(object key) if your datatable's primary key is two columns?

if so how? ...

How to 'union' 2 or more DataTables in C#?

How to 'union' 2 or more DataTables in C#? Both table has same structure. Is there any build-in function or should we do manually? ...

Getting the Foreign Key constraints of a table programatically

I'm trying to use a DataTable to get the schema of a SQL Server DB. But, when try to detect the ForeignKeys, the constraints collection only brings the UNIQUE constraints. Private Sub ShowConstraints(ByVal tableName As String) Dim table As DataTable = New DataTable(tableName) Using connection As SqlConnection = New SqlConnectio...

Sharing a DataTable across multiple forms in winforms

I'm trying to write a simple Compact Framework winforms app. The main form has a DataGrid bound to a DataTable (with data from an xml file). I want to bring up another form that displays the details of the current record. I have something like the following code as the constructor for the detail form. public DetailsForm(DataTable dtL...

Binding a GridView control to a DataTable

What is the sytnax for displaying a data table column on an ASP.NET page (.aspx)? I know it it along the lines of Container.DataItem, it has been awhile since I worked with DataTable object ...

DataGridView, ADO.NET, Binding, and Paging on the Client

I'm working on a WinForm application that has several queries that bring back approx 20000 records and then fills a DataTable, and binds that DataTable to a DataGridView. I want to allow the users to page through the grid 500 records at a time. What is the best way to do this? I want to do the paging on the client side. I see that the S...

Wpf Data entry Form bound to datatable...

Hi, I was trying my hand on binding in Wpf.I am trying to make a dataenrty screen.for instance,I have a textbox and a combobox and a listview.. users enter pick an item from the combobox,add a comment and add the item to the listview.This is the flow.I have a master table for the combobox,i have its selectedvalue bound to a Item field in...

Can I provide a datable row with a name?

Is it possible to provide datatable rows with names in string form as one does with columns? I want to be able to refer to a row via a name rather than an index. EDIT: My bad. I am working in C#. I should have stated that. I am doing market correlation studies using statistical analysis. I want to store the outputs of correlation stu...

Determining the field length of a column in a datatable

I have a DataTable that I have populated via the Dataset.ReadXML() method. I am trying to programatically determine the maximum field lengths for each column in the datatable. The MaxLength value for all of my columns is always at the default of -1. Any thoughts or examples on how to determine the proper max length? maybe based on the ...

How to relay dataset/datatable from Tomcat to a .NET application ?

I need to provide data to a DataTable in a .NET application from a servlet hosted in Tomcat. It seems tempting to just stream back XML the .NET application can just pupulate using DataTable.ReadXML. Is that the proper road to go down ? And not the least; are there existing Java components that can help me with this on the Tomcat side ? ...

Limitations to recording changes in a bound dataGridView to a dataTable

Hello, I was under the impression that upon binding a dataGridView object to a dataTable that any changes the user makes in the dataGridView are then recorded in the dataTable. These changes include switches in column order, sorting, and the addition and deletion of rows. However, this does not seem to be the case. I am finding that ...

JSF UIInput in DataTable Footer

I am adding (UIInput) to the footer columns (UIColumn) of a datatable (UIData) created dynamically. The UIData is bound to a datatable tag in the jsp. In the datatable, I just have headers and footers with the header having the labels and footer having the corresponding value in editable textbox. When I change the value and submit the fo...

Multiple threads filling up their result in one DataTable C#

Hi All, I'm just beginning to learn the concept of threading, and I'm kind of stuck at this one problem, its driving me crazy.... What I actually need to accomplish - I have some 300 text files in a local directory, that need to be parsed for specific values... After I find these "values" in each text file, I need to store them in a d...

How can I get values out of a selectOneMenu inside a JSF datatable?

Hi, I have a JSF datatable with a bunch of rows, with each row having a selectOneMenu inside of it like this: <h:form <h:dataTable id="myTable" binding="#{myBean.dataTable}" value="#{myBean.dataTableRows}" var="row" first="0" rows="0" dir="LTR" frame="hsides" rules="all"> <h:column> ...

Using own callback methods for AJAX request in Prototype

I have refactored working code to use proper objects and now I can't get Prototype's AJAX.Request to work properly. The code is following, it's working in context of YUI's DataTable: SearchTable.prototype.setTableColumns = function (transport) { this.dataTableColumns = transport.responseText.evalJSON(); this.dataTableCallbac...