Guest User

Untitled

a guest
Oct 20th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. For Each row As DataGridViewRow In ResultGrid.Rows
  2. 'CREATE PROCEDURE [dbo].[Ins_BonusSalary]
  3. ' @EmpId int
  4. ' ,@BonusType Varchar(50)
  5. ' ,@BonusAmount Numeric(18,2)
  6. ' ,@SalDate datetime
  7. ' ,@AddBy Varchar(50)
  8. ' ,@Jan numeric(18,2)
  9. ' ,@Feb numeric(18,2)
  10. ' ,@Mar numeric(18,2)
  11. ' ,@Apr numeric(18,2)
  12. ' ,@May numeric(18,2)
  13. ' ,@Jun numeric(18,2)
  14. ' ,@Jul numeric(18,2)
  15. ' ,@Aug numeric(18,2)
  16. ' ,@Sep numeric(18,2)
  17. ' ,@Oct numeric(18,2)
  18. ' ,@Nov numeric(18,2)
  19. ' ,@Dec numeric(18,2)
  20. ' ,@Year int
  21. ' ,@FromDt datetime
  22. 'AS
  23. Sqlstring &= "Exec Ins_BonusSalary " & _
  24. Val(row.Cells("EmpId").Value.ToString) & ",'" & _
  25. CmbBonusType.Text & "'," & _
  26. Val(row.Cells("BonusAmt").Value.ToString) & ",'" & _
  27. Format(ToDate.Value, "yyyy/MM/01") & "'," & _
  28. UserId & "," & _
  29. IIf(ResultGrid.Columns.Contains("Jan") = True, Val(row.Cells("Jan").Value.ToString), 0) & "," & _
  30. IIf(ResultGrid.Columns.Contains("Feb") = True, Val(row.Cells("Feb").Value.ToString), 0) & "," & _
  31. IIf(ResultGrid.Columns.Contains("Mar") = True, Val(row.Cells("Mar").Value.ToString), 0) & "," & _
  32. Val(row.Cells("Apr").Value.ToString) & "," & _
  33. Val(row.Cells("May").Value.ToString) & "," & _
  34. Val(row.Cells("Jun").Value.ToString) & "," & _
  35. Val(row.Cells("Jul").Value.ToString) & "," & _
  36. Val(row.Cells("Aug").Value.ToString) & "," & _
  37. Val(row.Cells("Sep").Value.ToString) & "," & _
  38. IIf(ResultGrid.Columns.Contains("Oct") = True, Val(row.Cells("Oct").Value.ToString), 0) & "," & _
  39. IIf(ResultGrid.Columns.Contains("Nov") = True, Val(row.Cells("Nov").Value.ToString), 0) & "," & _
  40. IIf(ResultGrid.Columns.Contains("Dec") = True, Val(row.Cells("Dec").Value.ToString), 0) & "," & _
  41. Val(row.Cells("Year").Value.ToString) & ",'" & _
  42. Format(FromDate.Value, "yyyy/MM/01") & "'," & vbNewLine
  43. Next
  44.  
  45. IIf(ResultGrid.Columns.Contains("Jan") = True, Val(row.Cells("Jan").Value.ToString), 0) & "," & _
  46.  
  47. If(ResultGrid.Columns.Contains("Jan") = True, Val(row.Cells("Jan").Value.ToString), 0) & "," & _
Advertisement
Add Comment
Please, Sign In to add comment