Questions tagged [datatable.select]

Select method in the .Net class System.Data.DataTable

The class System.Data.DataTable in .Net has a Select() method that allows to get certain DataTable rows that fill a certain filter and, optionally, in a specified order, depending on the overload used. Since .Net 1.1.

34 questions
1
vote
3 answers

DataTable need to sum a column with filter on it

I have a data table in C# with columns: Product|Status|ShipedVolume|TotalVolume A New 0 10 A New 5 20 B Closed 7 20 I want to sum (TotalVolume-ShipedVolume) filtered by product and…
Freewind
  • 151
  • 1
  • 6
1
vote
3 answers

Efficient way to Find and Replace values in DataColumn

I have a Dataset containing one DataTable and that table got 3 columns (Column1,Data,Column2) & multiple data-rows. I also have a dictionary which contains list of values that I need to search within DataColumn and the values with which I should…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
1
vote
1 answer

Assigning a datarow to at an index of datarows which are getting by a datatable select method, not updating that datatable

There is a datatable ( source ), and a copy of this datatable is created ( copy ), and in this copy, some rows are modified in DataGridView. After modification is over, A method is updating source datatable with modified rows in copy…
Yograj Gupta
  • 9,811
  • 3
  • 29
  • 48
0
votes
2 answers

Different "SELECT" syntax in MYSQL with "dtTable.Select" in .NET

I tried "SELECT" MYSQL syntax below using MySQL Query Browser, work normally. When I used this syntax into dtTable.Select(), error is "Syntax error on expression". Please help me, Thanks. Dim dtTable As DataTable = MyDataset.Tables("machine") Dim…
0
votes
0 answers

Datatable.Select() cannot filter a value contains "#"

A Database has a data like these OVS0001#R1 OVS0001#R2 OVS0001#R3 I try to filter by using Select() function . Datatable.Select(" ITEM_CODE='OVS0001#R1' ") The error message shows like these The expression contains invalid date…
Fame th
  • 1,018
  • 3
  • 17
  • 37
0
votes
1 answer

JEditable using Select on MVC 3

I'm currently want to display a list of data using DataTables. And I want to be able to edit the record inline. I could execute those with no problem. The problem is, when I try to use drop down list(select) on one of the field for JEditable,…
0
votes
0 answers

.NET DataView find row index from ToTable.Select

I have some code that finds a bunch of rows based on a search criteria and then finds the index of one of those rows. This works fine with a DataTable Dim drRows() As System.Data.DataRow = dt.Select(vstrSearchCriteria) If drRows.Length > 0 Then …
0
votes
1 answer

how to get value by index and not by column name in asp:repeater #Eval

I am trying to get the data using column index and not the column name using the <%#Eval('foo')%> expression (or any other way) in my repeater control. here are my codes : page :
roostaamir
  • 1,928
  • 5
  • 24
  • 51
0
votes
1 answer

Datatable Missing operand after 'TruckGrossWeight' operator

I have a datatable where I want to assign select query. But following error pops up:"Syntax error: Missing operand after 'TruckGrossWeight' operator." DataRow[] drs = dataTableForDropDowns .Select("LNGFuelAvailability=" +…
0
votes
2 answers

Object Reference Error filling a datarow

This is the code: Dim dr() As DataRow = DataSet.Tables("TableName").Select("EVENTNAME = '" & name & "'") I get an "Object reference not set to an instance of an object." Error when this line is executed. It is looping through a list of selected…
JPJedi
  • 1,498
  • 7
  • 32
  • 58
0
votes
1 answer

Does filtering a DataTable without a sort parameter preserve original order?

Per title, if I have a DataTable with columns for ID and Name, pre-sorted by name, and I issue a call such as DataRow[] matchingRows = dataTable.Select("ID = " + filterID); (i.e. without specifying a sort) will my array reliably come back in…
downwitch
  • 1,362
  • 3
  • 19
  • 40
0
votes
1 answer

Error while selecting a row from datatable

filteredrows = Server_Tables[i].Select("(TRIM(Tool Stored Place and Sheduled)='" + searchtext + "') OR (TRIM(Workgroup server to connect to dataset within the tool)='" + searchtext + "')"); while executing, i am getting "Syntax error: Missing…
0
votes
1 answer

can someone help me with Table.Select(Expression) where expression could be something like this Expression = "id in (1,2,3,4)"

Is there an example of Table.Select(Expression) where expression could be something like this: Expression = "id in (1,2,3,4)" I have a list if ids in a variable IdList. Table contains all the TS_Ids where as the IdList only has subset of the ids.…
8GB
  • 79
  • 3
  • 13
0
votes
2 answers

How to change the data layout of a data table with LINQ

Above is the screen shot of one of my Data Table. I am trying to transform this data into the following format so that I can bind it to one of my grid. I have tried LINQ but unsuccessful. Could please anyone help me how I can do this. Doesn't…
Learning Curve
  • 1,449
  • 7
  • 30
  • 60
0
votes
2 answers

Converting Grid Content to a ListView or Other for use in MVVM Pattern

I have a 5 X 4 Grid (code below) which works as desired for the shape of my data. I recently discovered it is virtually impossible to pass a grid from the View Model to the View and bind it to another grid in XAML and still maintain the MVVM pattern…
user2284452
  • 115
  • 1
  • 11