Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run SQL Queries on DataTables, or similar, in .Net, without an RDBMS

I'd like to have a dataset or datatables, and be able to run SQL statements on them, without using any external RDBMS.

For Example, to take take 2 datatables in a dataset and just join them outright with a SQL statement and Where clause, the result being a new datatable? For example if I have 2 datatables, named People and Addresses in a dataset (that I built using code, not getting from a database .. pardon the old fashioned Join syntax):

dim dtJoined as DataTable = MyDataSet.RunSQLQuery ("Select * from People, Orders Where People.PersonID=Orders.OrdereID")

Thanks

like image 548
FastAl Avatar asked Dec 04 '25 19:12

FastAl


2 Answers

It is not sql, but if you want to query datasets and datatables your best bet is to use LINQ to DataSet

like image 196
Ben Robinson Avatar answered Dec 06 '25 07:12

Ben Robinson


You're not going to be able to run SQL against it, because it isn't an RDBMS, but you can probably get what you want to accomplish using standard LINQ.

like image 20
Robaticus Avatar answered Dec 06 '25 08:12

Robaticus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!