M
Mark Matheney
Please help. Simple question.
I want to update a row in an SQL table. (using VS2003)
There are 2 keys:
tts_tkey and tts_tskey
and 3 fields to modify:
tts_activeflag
tts_lastmoddate
tts_lastmodifiedby
SqlUpdateCommandTS.CommandText = "UPDATE TechnicianSchedule " & _
"SET tts_activeflag = @tts_activeflag, " & _
"tts_lastmoddate = @tts_lastmoddate, " & _
"tts_lastmodifiedby = @tts_lastmodifiedby " & _
"WHERE (tts_tkey = @tts_tkey) AND (tts_tskey = @tts_tskey); "
' update this record ...
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_tkey").Value =
tstomarkinactive_tkey(ct)
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_tskey").Value =
tstomarkinactive_tskey(ct)
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_activeflag").Value = 0
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_lastmoddate").Value =
Now()
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_lastmodifiedby").Value
= s_tkey
Not sure what command to use, but neither of the following will update
the database:
SqlUpdateCommandTS.ExecuteNonQuery()
SqlDataAdapterTS.UpdateCommand = SqlUpdateCommandTS
Basically, my question is: what commands do I use when I want to loop
through an internal array, updating a SQL table? (using a DataAdapter)
Many thanks in advance.
Mark
I want to update a row in an SQL table. (using VS2003)
There are 2 keys:
tts_tkey and tts_tskey
and 3 fields to modify:
tts_activeflag
tts_lastmoddate
tts_lastmodifiedby
SqlUpdateCommandTS.CommandText = "UPDATE TechnicianSchedule " & _
"SET tts_activeflag = @tts_activeflag, " & _
"tts_lastmoddate = @tts_lastmoddate, " & _
"tts_lastmodifiedby = @tts_lastmodifiedby " & _
"WHERE (tts_tkey = @tts_tkey) AND (tts_tskey = @tts_tskey); "
' update this record ...
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_tkey").Value =
tstomarkinactive_tkey(ct)
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_tskey").Value =
tstomarkinactive_tskey(ct)
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_activeflag").Value = 0
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_lastmoddate").Value =
Now()
SqlDataAdapterTS.UpdateCommand.Parameters("@tts_lastmodifiedby").Value
= s_tkey
Not sure what command to use, but neither of the following will update
the database:
SqlUpdateCommandTS.ExecuteNonQuery()
SqlDataAdapterTS.UpdateCommand = SqlUpdateCommandTS
Basically, my question is: what commands do I use when I want to loop
through an internal array, updating a SQL table? (using a DataAdapter)
Many thanks in advance.
Mark