datatable

Event on datarow being read or accessed?

I'm looking for a method or an event that would get fired when a row in a datatable is accessed. I have a datatable with several thousand rows, and an image in at least one of the columns. I want to dynamically load and unload the image from the row when it gets accessed. I haven't seen any documentation that suggests that it's there, ...

How to get columns from datarow?

I have row collection. (DataRow[] rows) And i want to import all rows to another DataTable (DataTable dt) BUT HOW !? DataTable dt; if (drs.Length>0) { dt = new DataTable(); foreach (DataRow row in drs) { dt.Columns.Add(row???????) } //...

DataTables plugin for jquery and click event

I am trying to succeed at getting this jquery plugin to work corretly. What I need is a click event that will alow me to click a row and have a js window that will load another page using the row_id that is the primary key in the database. I'm really lost with javascript but I like the plugin and really would like to have this work if po...

Efficient way to check if DataTable has row

Hi, I have a function that search for a keyword and then return DataTable. I want to check if there rows inside because sometimes there's no query found. 'which one shoud I use ? If dtDataTable Is Nothing Then 'some code lbl_count.Text = "Found 0 result" End If If dtDataTable.Rows.Count > 0 Then ...

How to append one DataTable to another DataTable

I would like to append one DataTable to another DataTable. I see the DataTable class has two methods; "Load(IDataReader)" and "Merge(DataTable)". From the documentation, both appear to 'merge' the incoming data with the existing DataTable if rows exist. I will be doing the merge in a data access layer. I could could usa an IDataReader ...

Does the System.Data.DataTable have a size limit?

I'm adding data rows to my data table but the row count in the data table does not increase. Seems to be a limit of either size of the table or number of data rows. FYI, .net 2.0 ...

How can I find the size of a DataTable row in C#?

Does DataTable in C# provide a property that gives me the size of each row (number of bytes)? ...

How to store a vector of N dimensions in a datatable in C#?

How would you store a vector of N dimensions in a datatable in C#? ...

Datatable with rows of inputs

I have a datatable that generates rows of text inputs and selection lists and when I submit the values are null. I realize this is because jsf is generating separate random ID's for each input. I really need the data by rows and then parse out what I need. Any suggestions?: <h:dataTable id="returnableItems" value="#{returnableItemsBean....

linq orderbyAscending?

Hi I am using the following to sort results of a datatable returned by a tableadapter Dim spots = myDataTable.Where(Function(t) t.UserID = 1).OrderByDescending(Function(t) t.Title) The thing is, I also need to OrderByAscending the very same datatable. But as far as I see, it is not giving it as an option. I am sure there is a way to ...

how to convert data efficiently in DataTable in ADO.Net

Hello everyone, I am using ADO.Net + C# + VSTS 2008 + SQL Server 2005. I bind an ADO.Net DataTable to a real database table, and then bind the DataTable to a grid view on ASP.Net page. My question is, if I want to do some data manipulation work (very simple, like add some prefix to some character data type rows, multiple integer data ty...

Display DateTime data in users TimeZone in DataTable

We have a reporting application where all DateTimes are stored in UTC in the database (SQL server 2005) The reporting application works simply be retrieving a DataTable and binding to a DataGrid displaying the information. If we know the logged in users time zone (e.g. +3 GMT), is there any way to update the DataTables dates which are ...

Convert DataTable to CSV stream

Currently have a DataTable, but wish to stream it to the user via a WebHandler. FileHelpers has CommonEngine.DataTableToCsv(dt, "file.csv"). However it saves it to a file. How can I save it to a stream instead? I know how to do it when I know the columns in advanced or they don't change, but I want to generate the column headings straigh...

DataTables vs List(Of Object)

I'm having a debate with another programmer I work with. Are there any significant memory usage or performance differences, or other cons which should make someone avoid using the DataTable and favour lists(of object)... or vice versa I prefer using the lists because they are more lightweight, strong typing to the object when accessing...

How to return a DataTable from .Net Web Service?

I'v been able to return a HashTable from a Web Service that I setup for a .Net 2.0, but the service fails to retun a DataTable in JSON. I keep getting the following error: 'A circular reference was detected while serializing an object'. Any tips? [WebMethod(EnableSession = true) ] public DataTable getSavedAddresses() { DataTable ...

SQLiteDataAdapter does not fill the specified DataTable

Hello, I'm attempting to pull some data from a SQLite database so that I can populate a GridView in my GUI: here is the code that returns the DataTable: DataTable table = new DataTable(); SQLiteDataAdapter adapter = new SQLiteDataAdapter(this.command.CommandText, this.connection); adapter.Fill(table); return table; For some reason a...

DataGridView does not display DataTable

Hello, I've got the following code which I think ought to be binding a DataTable to a DataGridView, but the DataGridView shows up empty. The DataTable definately has rows, so I assume that I am binding the DataSource incorrectly some how. Does anyone see what is wrong with this: DataBase db = new DataBase(re.OutputDir+"\\Matches.db")...

Serializing DataTable with data inputted from DataGridView

Hi everyone, I am wondering if it's possible to add data to a DataTable through a DataGridView and save the data in the DataTable by serializing it--and all of this without having to create an underlying database. One DataTable is sufficient for the amount of data I am trying to store and a database is definitely overkill. Thanks! ...

Simple method of binding PictureBox Image to Datatable

Is there a simple way to bind a PictureBox image to a datatable? ...

Image in datatable

I read image by using OpenFileDialog. Sample code is below: openFileDialog1.ShowDialog(); if (openFileDialog1.FileName != null) if (picBoardImage.Image != null) { picBoardImage.Image.Dispose(); } picBoardImage.Image = Image.FromFile(openFileDialog1.FileName); I want to store this image in datatable. How can I do that? ...