Κάτι δεν κάνω καλά σε αυτά που μου λές Δημήτρη
Δίνω
Dim Changes As DataTable
Changes = data_table.GetChanges(data_row_state)
If Not (Changes Is Nothing) Then
'Προσοχή...Χρειάζονται όλα τα Fields του Changes και του sSQL για να δουλέψει το command_builder
sSQL = "SELECT * FROM " & data_table.TableName
Dim command As DbCommand = conn.CreateCommand()
command.CommandText = sSQL
Dim da_Sql As DbDataAdapter = dataFactory.CreateDataAdapter()
' Create INSERT, UPDATE, and DELETE commands.
Dim command_builder As DbCommandBuilder = dataFactory.CreateCommandBuilder() ' = da_Sql
da_Sql.SelectCommand = command
command_builder.DataAdapter = da_Sql
command.Transaction = transaction
'@
Select Case data_row_state
Case DataRowState.Added
da_Sql.InsertCommand = command_builder.GetInsertCommand()
da_Sql.InsertCommand.CommandText += ";SELECT TIM1ID FROM TIM1 WHERE (TIM1ID = SCOPE_IDENTITY())"
.
.
.
da_Sql.Update(Changes)
Dim dt As New DataTable
da_Sql.Fill(dt)
Αλλά στο dt μου φέρνει όλα τά rows to dt
Πως θα πάρω το TIM1ID column
George Matzouranis