PC Review


Reply
Thread Tools Rate Thread

How can I use real SQL on a DataTable? i.e. not array of rows using a filter... as in DataTable.Select

 
 
Dan V.
Guest
Posts: n/a
 
      30th Jun 2004
How can I use real SQL on a DataTable? i.e. not array of rows using a
filter... as in DataTable.Select.

I read at : microsoft.public.dotnet.framework.adonet

"As others have posted: There is no SQL query processor for DataSets. You
can use XPath with an XMLDataDocument built from the DataSet. You can also
perform selections based on criteria, using the Find and
Select methods, and you can create row filters using DataViews."

Is this true?


 
Reply With Quote
 
 
 
 
Greg Young
Guest
Posts: n/a
 
      30th Jun 2004
yes RowFilters are VERY powerful and more similar to what you might be
looking for ..

xpaths are also very powerful.

neither is "real" sql though.

"Dan V." <(E-Mail Removed)> wrote in message
news:OsyIU%(E-Mail Removed)...
> How can I use real SQL on a DataTable? i.e. not array of rows using a
> filter... as in DataTable.Select.
>
> I read at : microsoft.public.dotnet.framework.adonet
>
> "As others have posted: There is no SQL query processor for DataSets. You
> can use XPath with an XMLDataDocument built from the DataSet. You can also
> perform selections based on criteria, using the Find and
> Select methods, and you can create row filters using DataViews."
>
> Is this true?
>
>



 
Reply With Quote
 
Dan V.
Guest
Posts: n/a
 
      30th Jun 2004
After reading some articles I have a better idea.

I basically am creating a utility for myself that allows one to run a SQL
query or Filter on every table in every database in a path (including
subfolders if desired). It basically will be used mostly to find table
names and column names that match a pattern. When at least one row is found
it displays the 'table' in a DataGrid and has a next or quit button type of
thing.

So I am using GetSchema for schema stuff. and have a DataTable. Now how
would I populate a DataGrid?


"Greg Young" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> yes RowFilters are VERY powerful and more similar to what you might be
> looking for ..
>
> xpaths are also very powerful.
>
> neither is "real" sql though.
>
> "Dan V." <(E-Mail Removed)> wrote in message
> news:OsyIU%(E-Mail Removed)...
> > How can I use real SQL on a DataTable? i.e. not array of rows using a
> > filter... as in DataTable.Select.
> >
> > I read at : microsoft.public.dotnet.framework.adonet
> >
> > "As others have posted: There is no SQL query processor for DataSets.

You
> > can use XPath with an XMLDataDocument built from the DataSet. You can

also
> > perform selections based on criteria, using the Find and
> > Select methods, and you can create row filters using DataViews."
> >
> > Is this true?
> >
> >

>
>



 
Reply With Quote
 
Dan V.
Guest
Posts: n/a
 
      1st Jul 2004
I will use code like the following, and use a filter instead to work with
in-line memory data as opposed to running sql over the network again.

DataTable tblSchemaTable =

conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,

new object[] {null, null, null, "TABLE"})

OR

conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,

new object[] {null, null, tblName, null})



// http://www.knowdotnet.com/articles/dataviews1.html

// http://www.knowdotnet.com/articles/expressions.html

DataView dvSchema = tblSchemaTable.DefaultView;

dvSchema.RowFilter = "COLUMN_NAME like '%PCX%'"

if (dvSchema.Count > 0)

MyDataGrid.DataSource = dvSchema;


"Dan V." <(E-Mail Removed)> wrote in message
news:OBY$(E-Mail Removed)...
> After reading some articles I have a better idea.
>
> I basically am creating a utility for myself that allows one to run a SQL
> query or Filter on every table in every database in a path (including
> subfolders if desired). It basically will be used mostly to find table
> names and column names that match a pattern. When at least one row is

found
> it displays the 'table' in a DataGrid and has a next or quit button type

of
> thing.
>
> So I am using GetSchema for schema stuff. and have a DataTable. Now how
> would I populate a DataGrid?
>
>
> "Greg Young" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > yes RowFilters are VERY powerful and more similar to what you might be
> > looking for ..
> >
> > xpaths are also very powerful.
> >
> > neither is "real" sql though.
> >
> > "Dan V." <(E-Mail Removed)> wrote in message
> > news:OsyIU%(E-Mail Removed)...
> > > How can I use real SQL on a DataTable? i.e. not array of rows using a
> > > filter... as in DataTable.Select.
> > >
> > > I read at : microsoft.public.dotnet.framework.adonet
> > >
> > > "As others have posted: There is no SQL query processor for DataSets.

> You
> > > can use XPath with an XMLDataDocument built from the DataSet. You can

> also
> > > perform selections based on criteria, using the Find and
> > > Select methods, and you can create row filters using DataViews."
> > >
> > > Is this true?
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataTable.Select vs DataTable.rows.Find vs foreach Dave Microsoft C# .NET 1 17th May 2007 09:06 PM
DataTable.Select() - is it possible to pass rows back to datatable =?Utf-8?B?QW5kcmUgUmFuaWVyaQ==?= Microsoft ADO .NET 5 9th Nov 2005 05:10 PM
datatable.select with filter =?Utf-8?B?am1obWFpbmU=?= Microsoft Dot NET Framework 1 28th Jul 2005 07:43 PM
Retrieving datarows using DataTable.Select method and adding it to new DataTable C.Anand via DotNetMonster.com Microsoft ADO .NET 4 4th Apr 2005 05:21 PM
DataTable.Select returns no rows on a date filter =?Utf-8?B?U2lvYmhhbg==?= Microsoft ADO .NET 1 1st Jun 2004 10:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:48 PM.