DataRow is an ADO.Net class that represents a row of a data in a DataTable.
Questions tagged [datarow]
755 questions
0
votes
2 answers
C# getting values from DataTable or BindingSource
I have a labels that need values retreieved from a Database.
I am able to query the database but how can I extract values from a DataTable and place them in the appropiate labels
Thanks

Cocoa Dev
- 9,361
- 31
- 109
- 177
0
votes
1 answer
How create instance for datrow dynamically using Activator
i want to create instance for datarow using activator like this
dataItem = Activator.CreateInstance();
while i using this code i got exception
No parameterless constructor defined for this object.

YogeshWaran
- 2,291
- 4
- 24
- 32
0
votes
1 answer
The safe methods and convention standards of datasets, datatables, datarows
What are the essential controls before getting a piece of data from a row of a table of a dataset in c#? In order to get rid of the errors while converting a nullable data into decimal, or getting a coloumn that may not be in the datasource any…

Bilgin Kılıç
- 8,707
- 14
- 41
- 67
-1
votes
1 answer
Cannot Perform '-' operation on System.String and System.Decimal on DataTable.Select statement
I am trying to execute this select statement within my application and encounter the System.Data.EvaluateException "Cannot perform '-' operation on System.String and System.Decimal"
foreach (DataRow dataRow in dt.Rows)
string otherSTR =…

Micah Stovall
- 23
- 7
-1
votes
2 answers
DataRow "Specified Cast is invalid" C#
Can't figure out why this won't work. I get the same "Specified Cast is Invalid" error message. New to C#, be kind. It fails at the if(!((int)WrkRow["ManualWeight"] == 1 | etc. line. I tried a few variations of code, not all pasted here.…

CircleDot
- 15
- 7
-1
votes
1 answer
How do I get the value of a datarow after a space in c#?
So say I have a two word name in a DataRow with a space in between words. The entire name is represented as "poc" in the datarow. I can get the poc to display the full name no problem. The code looks like this :
foreach (DataRow mitRow in…

JonMarsh89
- 3
- 2
-1
votes
2 answers
Display deleted rows in a DataTable
So I have a DataTable that I bind to the DataGrid in XAML.
User is allowed to add, modify and remove rows for a table. I would like to mark rows with a specific colour, depending on the action that user makes. For instance, if user adds a row, that…

vic
- 9
- 3
-1
votes
1 answer
Recursive call to generic function with DataRow parameter - MakeGenericMethod Fails
the question is : if i have MyConvertDataRowToEntity(DataRow row )
and I call in with T object from type Parent and inside I call the same function with desendant type Child how should I pass the DataRow parameter ?
The problem is created when…

Tzvi Gregory Kaidanov
- 3,080
- 3
- 26
- 33
-1
votes
1 answer
How to insert x number of datarows from a datatable into a list?
I'm currently using an existing piece of code that can insert all data rows from a specified data table column into a list as integers. However, in the current code I can only add all data rows. I want to be able to insert x amount of data rows, how…

James VH
- 69
- 1
- 7
-1
votes
1 answer
C# Parallel.ForEach - randomly writes a null value to the DataRow
Why does the following code at random times write null values to the DataRow object?
ConcurrentDictionary dRowDict = new ConcurrentDictionary();
foreach (long klucz in data.Keys)
{
DataRow row = table.NewRow();
…

pl.lepko
- 1
- 5
-1
votes
2 answers
List vs List , which would be faster?
I am loading about 4 million records from the data base and processing them one row at a time. To do so, I am iterating through each data row of the data set which is resulting in issues with efficiency.
How can I make this faster? I tried using a…

Ashish Samant
- 45
- 8
-1
votes
1 answer
C# DataRow from DataTable not reading first value
I'm new to StackOverflow and I have a question here.
When I'm reading my Rows from a DataTable, the first time the result is empty (the app crash) and after if I'm in debug mode, I can see that the first row is read but its too late.
Here is the…

micro75
- 1
- 2
-1
votes
2 answers
Add row to WinForms combobox after populating it from a datatable
I'm populating a combobox from a datatable with the following code:
public void PopulateCategoryCbo()
{
string connString = string.Format();
NpgsqlConnection conn = new NpgsqlConnection(connString);
conn.Open();
…

marky
- 4,878
- 17
- 59
- 103
-1
votes
1 answer
import multiple line textfile
I have a textfile as shown in the image, I need to import this file into a table
but I need it in this format

Nusser
- 11
- 2
-1
votes
1 answer
c# how to get value from selected datarow from datatable
I have a winform which display datatable
33 Bulbasaur Seed Pokémon A strange seed was planted on its back at birth. The plant sprouts and grows with this POKéMON. 8.4 146.5
34 Ivysaur Seed Pokémon When the bulb on its back grows large, it…

jayko03
- 2,329
- 7
- 28
- 51