Is it possible to run a select query on DataTable object?
Say for instance, my DataTable had following structure
StudentID, SubjectID, Score
Now, I want list of Score where Score IS NOT NULL
SELECT Score
From TableName
WHERE Score IS NOT NULL
ORDER BY Score
Thanks 8 4094
Job,
You can use for that a
datatable.select 'this is not an SQL query
That returns a collection of datarows
Or a
datatable.defaultview.rowfilter = "score > 0"
the datatable.defaultview you can bind than directly to a datasource.
datagrid.datasource = datatable.defaultview
I hope this helps,
Cor
Job,
You can use for that a
datatable.select 'this is not an SQL query
That returns a collection of datarows
Or a
datatable.defaultview.rowfilter = "score > 0"
the datatable.defaultview you can bind than directly to a datasource.
datagrid.datasource = datatable.defaultview
I hope this helps,
Cor
Add a DataView that has a filter to filter out the nulls. Then you can bind
the view to controls in your application.
NOTE: Even when you bind a table you are technically binding a view, as the
DefaultView() is used.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Job Lot" wrote: Is it possible to run a select query on DataTable object?
Say for instance, my DataTable had following structure
StudentID, SubjectID, Score
Now, I want list of Score where Score IS NOT NULL
SELECT Score From TableName WHERE Score IS NOT NULL ORDER BY Score
Thanks
Add a DataView that has a filter to filter out the nulls. Then you can bind
the view to controls in your application.
NOTE: Even when you bind a table you are technically binding a view, as the
DefaultView() is used.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Job Lot" wrote: Is it possible to run a select query on DataTable object?
Say for instance, my DataTable had following structure
StudentID, SubjectID, Score
Now, I want list of Score where Score IS NOT NULL
SELECT Score From TableName WHERE Score IS NOT NULL ORDER BY Score
Thanks
That will return me array of datarow with all the columns in it. I want to
pull out only Score column without null values.
"Cowboy (Gregory A. Beamer) - MVP" wrote: Add a DataView that has a filter to filter out the nulls. Then you can bind the view to controls in your application.
NOTE: Even when you bind a table you are technically binding a view, as the DefaultView() is used.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA
*************************** Think Outside the Box! ***************************
"Job Lot" wrote:
Is it possible to run a select query on DataTable object?
Say for instance, my DataTable had following structure
StudentID, SubjectID, Score
Now, I want list of Score where Score IS NOT NULL
SELECT Score From TableName WHERE Score IS NOT NULL ORDER BY Score
Thanks
That will return me array of datarow with all the columns in it. I want to
pull out only Score column without null values.
"Cowboy (Gregory A. Beamer) - MVP" wrote: Add a DataView that has a filter to filter out the nulls. Then you can bind the view to controls in your application.
NOTE: Even when you bind a table you are technically binding a view, as the DefaultView() is used.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA
*************************** Think Outside the Box! ***************************
"Job Lot" wrote:
Is it possible to run a select query on DataTable object?
Say for instance, my DataTable had following structure
StudentID, SubjectID, Score
Now, I want list of Score where Score IS NOT NULL
SELECT Score From TableName WHERE Score IS NOT NULL ORDER BY Score
Thanks
That will return me array of datarow with all the columns in it. I want to
pull out only Score column without null values.
"Cor Ligthert" wrote: Job,
You can use for that a datatable.select 'this is not an SQL query That returns a collection of datarows
Or a datatable.defaultview.rowfilter = "score > 0"
the datatable.defaultview you can bind than directly to a datasource. datagrid.datasource = datatable.defaultview
I hope this helps,
Cor
That will return me array of datarow with all the columns in it. I want to
pull out only Score column without null values.
"Cor Ligthert" wrote: Job,
You can use for that a datatable.select 'this is not an SQL query That returns a collection of datarows
Or a datatable.defaultview.rowfilter = "score > 0"
the datatable.defaultview you can bind than directly to a datasource. datagrid.datasource = datatable.defaultview
I hope this helps,
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Job Lot |
last post by:
Is it possible to run a select query on DataTable object?
Say for instance, my DataTable had following structure
StudentID, SubjectID, Score
Now, I want list of Score where Score IS NOT NULL...
|
by: JC |
last post by:
Hi,
I have a database that imports 4 reports to my "data" table, each
report has its own identifier. Then I have a table with Analysts with
the report identifier that they are to be assigned to. ...
|
by: Ramesh |
last post by:
hi,
I am selecting fields from three table for manupulating
data and i want to display total number of records
selected. But i am always getting -1 value, eventhough
1000 of records are selected....
|
by: aaj |
last post by:
Hi all
I use a data adapter to read numerous tables in to a dataset.
The dataset holds tables which in turn holds full details of the records
i.e. keys, extra colums etc..
In some cases I...
|
by: rodchar |
last post by:
Hey all,
Is there a way to get similar functionality as the SELECT DISTINCT records
in a SQL Statement when selecting records from a dataset?
thanks,
rodchar
|
by: Ron L |
last post by:
I have a data table that lists a series of items in my database. In my user
form, I want the user to be able to filter by a number of criteria (e.g.
location, contract, date modified, etc). Other...
|
by: =?Utf-8?B?UmljaA==?= |
last post by:
Greetings,
I have to load 30,000 unique names into a combox. Filling a dataTable takes
only a few milliseconds. But populating the combobox and displaying the list
takes several seconds - way...
|
by: Nathan Sokalski |
last post by:
I want to select only the first n records from a database using VB.NET. I
have declared a DataTable and OleDB.OleDbDataAdapter as follows:
Dim linkstable As New DataTable
Dim linksadapter As New...
|
by: StefanPienaar |
last post by:
Hi Guys
Is there any way in c# (or vb.net) to extract a datatable of data from a dataset with multiple datatables which has relationships set up (containing combined data from the datatables)?
...
|
by: kurtzky |
last post by:
i created a form that should function as follows:
i will enter a number in a textbox..then it should query from the database all the records which has that number..these records will have a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |