- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
'==========================================================================
'обновляю таблицу okFIO
lcSQl = "UPDATE okFIO SET"
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!dateBegin Is System.DBNull.Value) Then
lcSQl &= " dateBegin = '" & Format(Me.DS_ExportFIO.okFIO.Rows(0)!dateBegin, "yyyyMMdd") & "'"
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!Prim Is System.DBNull.Value) Then
lcSQl &= ", Prim = '" & Me.DS_ExportFIO.okFIO.Rows(0)!Prim.ToString & "'"
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!oldFam Is System.DBNull.Value) Then
lcSQl &= ", oldFam = '" & Me.DS_ExportFIO.okFIO.Rows(0)!oldFam.ToString & "'"
End If
'If Not (Format(Me.DS_ExportFIO.okFIO.Rows(0)!dateFill.ToString, "yyyyMMdd")) = "" Then
' lcSQl &= ", dateFill = " & Format(Me.DS_ExportFIO.okFIO.Rows(0)!dateFill.ToString, "yyyyMMdd") & ""
'End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!FIOR Is System.DBNull.Value) Then
lcSQl &= ", FIOR = '" & Me.DS_ExportFIO.okFIO.Rows(0)!FIOR.ToString & "'"
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!FIOD Is System.DBNull.Value) Then
lcSQl &= ", FIOD = '" & Me.DS_ExportFIO.okFIO.Rows(0)!FIOD.ToString & "'"
End If
......
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!isSoprPF Is System.DBNull.Value) Then
lcSQl &= ", isSoprPF = " & Me.DS_ExportFIO.okFIO.Rows(0)!isSoprPF.ToString & ""
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!isReadyFotoPC Is System.DBNull.Value) Then
lcSQl &= ", isReadyFotoPC = " & Me.DS_ExportFIO.okFIO.Rows(0)!isReadyFotoPC.ToString & ""
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!isReadySignPC Is System.DBNull.Value) Then
lcSQl &= ", isReadySignPC = " & Me.DS_ExportFIO.okFIO.Rows(0)!isReadySignPC.ToString & ""
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!SNILS Is System.DBNull.Value) Then
lcSQl &= ", SNILS = '" & Me.DS_ExportFIO.okFIO.Rows(0)!SNILS.ToString & "'"
End If
If Not (Me.DS_ExportFIO.okFIO.Rows(0)!idPrivilege Is System.DBNull.Value) Then
lcSQl &= ", idPrivilege = " & Me.DS_ExportFIO.okFIO.Rows(0)!idPrivilege.ToString & ""
End If
lcSQl &= " WHERE(id = " & Me.idFIO & ")"
myCommand = New SqlClient.SqlCommand(lcSQl, myConn)
myCommand.CommandTimeout = 0
myCommand.ExecuteNonQuery(
И так далее... всего около 150ти строк кода (весь сюда запихнуть не могу) на формирования SQL-запроса.