Hey all,
I have a web application that has a requirement to take data from an Excel workbook and load it to the database. I am using ADO.NET 2.0 and need to use DataSet/DataTable/DataAdapter/etc. to perform this task.
We also have a requirement of verifying the data before it is uploaded and informing the user if there are any PK/FK/U...
I am suing SqlDataReader to read data from SQL Server. However sometimes I want to cache my data in memory as read only lightweight connection free object. I couldn't find any options for me in the BCL. Do I need to write my own implementation of such container, or are any available?
What alternatives do I have for storing data from dat...
I would like to use the Microsoft Report Viewer component to view a report created from a programatically filled datatable.
I have been looking for a while but the only information I can find is for reporting on information from a database.
...
I have a datatable something like this:
| Col1 | Col6 | Col3 | Col43 | Col0 |
---------------------------------------------------
RowA | 1 | 6 | 54 | 4 | 123 |
As you see, the Cols are not sorted by their numbers. That is what I want it to look like after the "magic":
| Col0 | Col1 | Col3...
I'm using a databound WinForms DataGridView; how do I go from a user selected row in the DGV to the DataRow of the DataTable that is its source?
...
Hello All,
I'm using the following code to populate a DataGridView (sqliteAdapter derives from DbDataAdapter):
sqliteAdapter.SelectCommand.CommandText = SQLCommand;
sqliteConn.Open();
using (DataTable dt = new DataTable())
{
sqLiteAdapter.Fill(dt);
dataGridRes.DataSource = dt;
}
The Actual SQLCommand is:
SELECT Email NOTNULL...
Hello, i have a lot of some WPF windows. On them i write some code, which binds UI controls and data, something like this:
public class AddressWindow
{
public string AddressID { get; set; }
public string Addr1 { get; set; }
public string Addr2 { get; set; }
public string ZIP { get; set; }
...
Hi,
I have a Datatable assigned to a DataGrid in main thread. I am updating the same DataTable from two different thread classes. Although the rows gets updated successfully in DataGrid control, I get following execption:
NotSupportedException thrown, with the
message saying 'This type of
CollectionView does not support
chan...
I created a class called CustomData which uses another one called CustomOptions as one of its fields. I want to use the CustomData in a DataTable as values. Here's a short overview (simplified, the fields are private and the accessors public, mostly readonly and the set is done by custom methods);
enum CustomDataOptionType
{
// Some va...
Hello all,
I cannot seem to be able to find a way to do a full text search on a databound DataGridView control across the entire breath of its columns and rows.
The DataTable and DataView objects seems to force me into searching for specific columns either through Select(), Find(), or FindRows(). Same with the DataGridView control.
I ...
Say I have 3 Dictionary<string, string> objects. All 3 have the same key like so:
Dic1 Dic2 Dic3
K V K V K V
A s A z A i
B d B e B u
C a C r C o
D w D t D p
Now, I would want to combine these dictionaries in to one DataTable, the DataTable should look like:
A s z i
B d e u
C a r o
D w t p
An...
Hi! I have problem with h:datatable tag in JSF. I don't know, why my datatable is not showing on my page. Some advices?
Here is my code:
<h:dataTable rows="2" var="deb" value="#{debCredTab.rows}">
<h:column>
<f:facet name="header">
Debet
</...
Earlier I asked a question about merging a known number of dictionaries into 1 single DataTable: http://stackoverflow.com/questions/1831209/dictionaries-in-datatable
Darin provided me with a satisfactory solution to the problem at hand.
But my problemset has evolved. I can no long be certain of the amount of dictionaries I get supplied. ...
Hi, i´m trying to query a DataTable object without specifying the fields, like this :
var linqdata = from ItemA in ItemData.AsEnumerable()
select ItemA
but the returning type is
System.Data.EnumerableRowCollection<System.Data.DataRow>
and I need the following returning type
System.Data.EnumerableRowCollection<<object,object>>
(...
Hello all,
This is what I'm currently using to implement a "Check all" feature on a bound DataGridView:
int max = ((DataTable)dataGridRes.DataSource).Rows.Count;
for (int i = 0; i < max; i++)
{
if(((DataTable)dataGridRes.DataSource).Rows[i].Field<long>(0) == 0)
((DataTable)dataGridRes.DataSource).Rows[i].SetField(0, 1);
}
...
I need some help with make a datatable from sql. Is it someone that can help me please. I'm a Newbie. But I want to make my own datatable from scratch in codebehind and now with the premade that is in Visual Studio.
Can someone please help me do this?
...
I am developing using C# 3 and .NET 3.5 and have an object where the contents of a CSV file (of an unknown format) are held in a byte[] property. I need to parse this byte[] and create a System.DataTable containing the columns and rows.
The problem is creating a System.DataTable where column data types match the data in the CSV.
I am c...
If I write:
myDataGridView.DataSource = myDataTable.Select(fitlerString);
myDataGridView.Sort(myDataGridView.Columns[1], ListSortDirection.Ascending)
I get an InvalidOperationException with the Message "DataGridView control must be bound to an IBindingList object to be sorted." but I can't find a way to get a Datatable (instead of a D...
I have a gridview with a boundfield and a templatefield (textbox). I'd like to iterate through the rows of the grid and get the underlying data out, including the data key for the grid rows themselves.
Given the following gridview row elements, how would I go about reverse engineering the data?
<asp:BoundField HeaderText="Due Date" Dat...
Hi I have datatype for a field recently converted to xml from varchar(MAX) in SqlServer DB.
I want to set this type for the corresponing field in the data table, but it has no option for xml. Any suggestion ?
Thanks
using VS 08 and SQL SERVER 08
...