Re: Execute SQL statement on Dataset



This is irrelevant Scott. By executing an UPDATE against a table, he implied
that the operation would change all of the rows specified by the WHERE
clause. While you can use the "Select" method/property against a table, to
find a subset of the rows, this will not permit one to execute an action
against all of those rows--not without visiting each one.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Scott M." <s-mar@xxxxxxxxxxxxx> wrote in message
news:u5kOOnzVFHA.3152@xxxxxxxxxxxxxxxxxxxxxxx
> Not true,
>
> A DataSet contains a Tables collection that is made up of DataTable
> objects. A DataTable is what actually contains the data. A DataTable has
> a "Select" method and this method takes an optional filterExpression
> argument. This FilterExpression argument allows you to query a DataTable
> in a SQL fasion.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatatableclassselecttopic.asp
>
> -Scott
>
>
>
> "Marina" <someone@xxxxxxxxxx> wrote in message
> news:O9fy0AzVFHA.132@xxxxxxxxxxxxxxxxxxxxxxx
>> The dataset is not an in memory database engine. You can't do anything
>> like that.
>>
>> "pierrev" <pierrev@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:6B435078-7D6C-4F86-ADED-D8B4A6C0CFBA@xxxxxxxxxxxxxxxx
>>> Hi,
>>>
>>> Is there a way to execute SQL statement on a Dataset?
>>>
>>> For example, my Dataset contains 1 table and I want to execute the
>>> following
>>> SQL statement:
>>>
>>> UPDATE table1 SET Field1='x' WHERE Field2='y'
>>>
>>> I know I can use filter and loop on the rows but I have many SQL
>>> statements
>>> I'ld like to reuse them.
>>>
>>> Thanks,
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Opinions on approach, please...
    ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... then simply EXECUTE that without passing it any parameters? ... Hard code WHERE clauses. ...
    (comp.lang.cobol)
  • Re: SQL Injection- Bypassing magic_quotes
    ... Because i was trying to execute: ... Don't terminate the query and you most ... Or try something like bobcat or one of the other SQL injection tools out ... Chief Information Security Officer ...
    (Pen-Test)
  • Re: Opinions on approach, please...
    ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... then simply EXECUTE that without passing it any parameters? ... explicitly code dummy words as bind variable placekeepers, put the host variables on the ...
    (comp.lang.cobol)
  • Re: UPDATE query in Access 2003 raising error
    ... string into a variable strSQL but create the qrydef from a string strSQLx (I ... Runtime error 3066 Query must have at least one destination field. ... The SQL works fine if I use it in the QBF Design mode. ... Elsewhere in the code I use the same technique to execute an SQL ...
    (microsoft.public.access.formscoding)
  • Re: Poor performance when executing stored procedure
    ... > Generally I would write stored procedures to do only one job. ... If SQL Server ... > which is even worse those sps can execute each other. ... > then executed spOrders which is executed in spCustomers and then got stuck ...
    (microsoft.public.sqlserver.programming)

Loading