I'm already using a command builder (see original post).
I have a valid SELECT statement, valid connection, and
send a datatable into the update method of the data
adapter.
Part of my confusion with your suggested query using
parameters is correlating parameters to original and
current values of a datarow, and how to ignore a field
which cannot change (autonumber). It's starting to look
easier to just build a command and execute a non-query...
Thanks for your help.
[color=blue]
>-----Original Message-----
>Hello,
>
>As bernie points out , you can use the CommandBuilder[/color]
class. However, it has[color=blue]
>limitations, if you SQL queries are simple, then it may[/color]
suit you to do this.[color=blue]
>
>As far as the parameters are concerned, the ? characters[/color]
are placeholders as[color=blue]
>connecting with OLEDB you cannot have named parameters[/color]
as you do in SQL, so[color=blue]
>the Parameters have to be read in the order of the SQL[/color]
statement and the ?[color=blue]
>means an unknown value being returned.( Thats why its a[/color]
question mark ).[color=blue]
>
>Try the builder, you can find references in the help.
>
>Regards - OHM
>
>
>rriness wrote:[color=green]
>> I was hoping not to have to build my own command - the
>> select statement meets the requirements of a single
>> table, with a one field primary key....
>>
>> In your query how do you map the ? (parameters) to
>> fields/alternate values? (Each field has an original
>> value, a current value if changed since the data was
>> read). Thanks for your help.
>>[color=darkred]
>>> -----Original Message-----
>>> Here is an example of an update query I did with an[/color][/color][/color]
access DB.[color=blue][color=green][color=darkred]
>>> Compare with Yours.
>>>
>>> Regards - OHM
>>>
>>> 'setup People Update Command
>>>
>>> peopleUpdateCmd.CommandText = "UPDATE People SET[/color][/color][/color]
Address1 = ?,[color=blue][color=green][color=darkred]
>>> Address2 = ?, Address3 = ?, Address4 = ?, Country" & _
>>>
>>> " = ?, County = ?, DOB = ?, Email = ?, FirstName = ?,[/color][/color][/color]
[Home Phone] =[color=blue][color=green][color=darkred]
>>> ?, LastName " & _
>>>
>>> "= ?, MiddleInnitial = ?, [Mobile Fone] = ?, [Post[/color][/color][/color]
Code] = ?, Town =[color=blue][color=green][color=darkred]
>>> ? WHERE (ID " & _
>>>
>>> "= ?) AND (Address1 = ?) AND (Address2 = ?) AND[/color][/color][/color]
(Address3 = ?) AND[color=blue][color=green][color=darkred]
>>> (Address4 = ?)" & _
>>>
>>> " AND (Country = ?) AND (County = ?) AND (DOB = ?)[/color][/color][/color]
AND (Email = ? OR[color=blue][color=green][color=darkred]
>>> ? IS NULL AN" & _
>>>
>>> "D Email IS NULL) AND (FirstName = ?) AND ([Home[/color][/color][/color]
Phone] = ?) AND[color=blue][color=green][color=darkred]
>>> (LastName = ?) A" & _
>>>
>>> "ND (MiddleInnitial = ? OR ? IS NULL AND[/color][/color][/color]
MiddleInnitial IS NULL) AND[color=blue][color=green][color=darkred]
>>> ([Mobile Fon" & _
>>>
>>> "e] = ? OR ? IS NULL AND [Mobile Fone] IS NULL) AND[/color][/color][/color]
([Post Code] =[color=blue][color=green][color=darkred]
>>> ?) AND (Town =" & _
>>>
>>> " ?)"
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Best Regards - OHMBest Regards - OHM[/color][/color][/color]
OneHandedMan@BTInternet.Com[color=blue][color=green][color=darkred]
>>> "rriness" <anonymous@discussions.microsoft.com> wrote[/color][/color][/color]
in message[color=blue][color=green][color=darkred]
>>> news:03e201c3b867$1261d6d0$a501280a@phx.gbl...
>>>> I'm getting an inconsistent failure when trying to[/color][/color][/color]
save[color=blue][color=green][color=darkred]
>>>> data in ADO.Net.
>>>>
>>>> I'm using an Access database with a simple query -[/color][/color][/color]
SELECT[color=blue][color=green][color=darkred]
>>>> StudentID, FirstName, LastName FROM Students - and[/color][/color][/color]
have[color=blue][color=green][color=darkred]
>>>> no other users in the database. I keep getting the
>>>> message 'Operation must use an updateable query.'
>>>>
>>>> Process seems to work on some PC's, not others. Is[/color][/color][/color]
there[color=blue][color=green][color=darkred]
>>>> a difference in .Net framework versions? Or some[/color][/color][/color]
other[color=blue][color=green][color=darkred]
>>>> place to look for the problem? I'm using a[/color][/color][/color]
datatable, and[color=blue][color=green][color=darkred]
>>>> dataadapter with command builder, using disconnected
>>>> data. Help!
>>>
>>>
>>> .[/color][/color]
>
>Best Regards - OHMBest Regards - OHM[/color]
OneHandedMan@BTInternet.Com[color=blue]
>
>
>.
>[/color]