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
11
votes
1 answer

Min (5) must be less than or equal to max (-1) in a Range object?

I am getting the error in the inner foreach while using Select in datatable. Here is the code I tried so far foreach (DataRow drOuter in dtLogic.Select("Name='>' OR Name='='")) { foreach (DataRow drInner in dtLogic.Select("ParentId=" +…
Shilpa Praneesh
  • 255
  • 2
  • 4
  • 12
10
votes
3 answers

How to correctly filter a datatable (datatable.select)

Dim dt As New DataTable Dim da As New SqlDataAdapter(s, c) c.Open() If Not IsNothing(da) Then da.Fill(dt) dt.Select("GroupingID = 0") End If GridView1.DataSource = dt …
Phil
  • 1,811
  • 9
  • 38
  • 60
8
votes
6 answers

DataTable.Select and Performance Issue in C#

I'm importing the data from three Tab delimited files in the DataTables and after that I need to go thru every row of master table and find all the rows in two child tables. Against each DataRow[] array I found from the child tables, I have to again…
Jhelumi786
3
votes
2 answers

c# DataTable select not working with special characters #

I have a datatable select like: productData.Select("Name = 'AAA BBB # CCC'"); I know the entry is there, it just doesn't work because of the # character. I have tried escaping with [] like: productData.Select("Name = 'AAA BBB [#] CCC'"); but it…
m3ntat
  • 3,635
  • 11
  • 38
  • 50
2
votes
1 answer

How to select data from datatable

I am little bit stuck here .. I have a datatable as _ Dim dtPupil As New DataTable dtPupil.Columns.Add("PupilId", GetType(Integer)) dtPupil.Columns.Add("Forename", GetType(String)) dtPupil.Columns.Add("Surname", GetType(String)) I made a select…
Laurence
  • 7,633
  • 21
  • 78
  • 129
2
votes
3 answers

How to Use 'IN' on a DataTable

I have this code in MS SQL: select * from table where column1 in (select column2 from table) How can I translate this using a DataTable? Something along the lines of: table.select("column1 in column2")
Gerald Torres
  • 403
  • 6
  • 18
2
votes
6 answers

How can I strip a single quote from a dataTable.Select( ) query in C#?

So I have a list of dealers names and I am searching them in my datatable -- problem is, some chucklehead HAS to be named 'Young's' --- this causes an error. drs = dtDealers.Select("DealerName = '" + dealerName + "'"); So I tried to replace the…
Todd Vance
  • 4,627
  • 7
  • 46
  • 66
2
votes
1 answer

DataTable.Select injection

Is there possible to use sql-injection code while invoking DataTable.Select? How can I restrict such vulnerability or get rid of it at all?
Blablablaster
  • 3,238
  • 3
  • 31
  • 33
1
vote
2 answers

Checking for null value with DataTable.Select

I'm using a DataTable select like this: DataRow[] rows = employees.Select("Name LIKE '%" + TB_Search.Text + "%'"); LV_Employees.DataSource = rows; LV_Employees.DataBind(); I have a listview where I'm checking a value that is contained in the…
abney317
  • 7,760
  • 6
  • 32
  • 56
1
vote
3 answers

How to search User Input within DataTable Column

Currently I'm searching as below. DataRow[] rows = dataTable.Select("FieldName='"+ userInput + "'"); The problem here is whenever user provides an input with single quote ('), it throws error. I can easily correct it by DataRow[] rows = …
IsmailS
  • 10,797
  • 21
  • 82
  • 134
1
vote
1 answer

Trouble with ".select()" Method in Peewee

I am making a peewee database. In my python code I try to retrieve rows from the model that may be empty: player_in_db = Player.select().where(Player.name == player.name_display_first_last) Player is the name of the model name is a field instance in…
leojacoby
  • 75
  • 8
1
vote
1 answer

Problem with DataTable.Select method

I have my strings in a String array, my Data in a datatable. What I have to do is, select a single row using datatable.select(string) method and delete it from the datatable. this is what I am doing, and its working fine many times but its returning…
YCN
  • 667
  • 2
  • 9
  • 25
1
vote
3 answers

Datable.Select sort expression

I have datatable with column name tag and 100 rows of data.I need to filter this table with tag starting with "UNKNOWN". What should my sortexpression for datatable.select be ? I'm trying the following. Datarow[] abc = null; abc =…
xyz
  • 13
  • 2
1
vote
2 answers

DataTable DataRow Select String with Quotation Marks

My string include quotation mark; the select statement crash. vm_TEXT_string = "Hello 'French' People"; vm_DataTable_SELECT_string = "[MyField] = '" + vm_TEXT_string + "'"; DataRow[] o_DataRow_ARRAY_Found = vco_DataTable.Select…
RBrattas
  • 11
  • 2
1
vote
1 answer

Input String is not in Correct Format / DataTable.Select Method

Hi I have a problem, when I am trying to use DataTable.Select to get column values.. Actually it is working file in C# which I have converted using Converters. I am using .NET 1.1 / VS 2003...input string was not in correct format.. Dim drs As…
msbyuva
  • 3,467
  • 13
  • 63
  • 87
1
2 3