Questions tagged [system.data.datatable]

57 questions
0
votes
1 answer

Autonumber and datatable with dbnull exception

i was doing some work on a datatable i filled with a oledbdataadapter made from an access database. and i stumbled upon this error: Turns out that my table has this structure: ID --> autonumber(PK) lazos_>text Asociaciones->text and when i fill my…
Joaquin
  • 5
  • 2
  • 5
0
votes
1 answer

Update PostgreSQL JSON using system.data.dataset

I'm trying to update a JSON field in PostgreSQL (v14) using PowerShell system.data.dataset method but keep getting error: "ERROR [42883] ERROR: operator does not exist: json = unknown; I just want to read the JSON field as a string then update a…
Barbara
  • 25
  • 3
0
votes
0 answers

What comparer does DataTable.Compute use?

If I implement the following: var maxValue = dataTable.Compute("Max(columnName)"); then presumably the type of maxValue will be the datatype of the 'columnName' column in dataTable (or will it??). But what comparer does the Max expression use, and…
Dave
  • 3,429
  • 2
  • 26
  • 29
0
votes
1 answer

Copy source datatable to destination datatable with the schema of destination

I'm trying to copy the data from source dt to destination datatable. source datatble types are sting and destination datatble types contains datetime along with strings. datatable dt2=new datatable(); foreach (DataRow row in dt1.Rows) { …
Ashu
  • 11
  • 5
0
votes
1 answer

Updating DataTable

for(int i = 0; i < m_DataTable.Rows.Count; i++) { m_DataTable.Rows[i]["WORKER"] = "test"; m_DataTable.Rows[i].AcceptChanges(); } m_DataTable.AcceptChanges(); Is there any reason that I can not see that this code does not update my…
0
votes
2 answers

Converting DataTable to string type

I have a function like this public DataTable GetAllPrimaryKeyTables(string localServer, string userName, string password, string selectedDatabase) { // Create the datatable DataTable…
Srivastava
  • 3,500
  • 12
  • 46
  • 74
0
votes
0 answers

What's the proper loop control structure to give the correct output?

I'am trying to prepare a scheduling algorithm where i have used 3 DataTables in order to hold lecturer details panel details and hall availability details. I am using for loops to access DataTables. I found that for loop control structure doesn't…
dgcharitha
  • 333
  • 3
  • 13
0
votes
1 answer

How to store sorted records in csv file?

I sort the records of the datatable datewise with the column TradingDate which is type of datetime. TableWithOnlyFixedColumns.DefaultView.Sort = "TradingDate asc"; Now I want to store these sorted records into csv file but stored records are not…
Harikrishna
  • 4,185
  • 17
  • 57
  • 79
0
votes
0 answers

C# windows application binding a gridview

In my application I have 2 datatables. One is NameTable (Id,Name), other is FriendsTable(NameId,Name). NameId of FriendsTable is the Id of NameTable. Now in my application I want to display data in gridview as follows: Gridview should show NameTable…
Manish Gupta
  • 449
  • 2
  • 6
  • 16
0
votes
1 answer

Customizing tables returned from Google.DataTable.Net.Wrapper with Format

I am making a custom report using Google Visualization API. It will have 6 sections with each section having tables on either side and a chart in the middle. Since the formats differ slightly I was spending a lot of time defining classes for each…
gooddadmike
  • 2,329
  • 4
  • 26
  • 48
0
votes
1 answer

Error "Cannot add a nested relation" when trying to add identity datacolumn to datatable from XML?

I get the following error when trying to add a datacolumn to a datatable: Cannot add a nested relation or an element column to a table containing a SimpleContent column. This happens when I hit this code the first time mt.Columns.Add("IdentityId",…
Joe_Hendricks
  • 746
  • 4
  • 16
0
votes
1 answer

Display currency in System.Data.DataTable

I'm working on some old VB code which creates a System.Data.DataTable and defines some columns. It works fine, except that I need a certain column to display as currency, not just a floating point number. How do I this? Dim myDataTable As New…
Al Lelopath
  • 6,448
  • 13
  • 82
  • 139
0
votes
2 answers

LINQ Join between datatables, two untyped fields

I'm querying two databases and trying to join the result sets and query out of them using LINQ. It seems it would be an easy task, but without doing an explicit join I'm having major performance issues. When I do the explicit join, I am having…
Dylan Brams
  • 2,089
  • 1
  • 19
  • 36
0
votes
1 answer

C# - Binding a GridView Eval data without a Data Source Control

I am looking to populate a (sorted) GridView (called SearchResultsGid) without the use of a data source control. I did some research and I am guessing I may need to use a data set and datable to successfully bind the the grid, but I am not entirely…
Dejsa Cocan
  • 1,539
  • 3
  • 19
  • 56
0
votes
1 answer

SqlCeException Not enough storage

I have scanner application on Windows Mobile 6.5 device. The application keeps crashing after I scan 100 items or so (where I open SqlCe Connection and execute SQL query to populate temporary DataTable with query result). Here how my C# code looks…
22332112
  • 2,337
  • 5
  • 21
  • 42