Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. var currentPriorityKey = chkbxActionItem.Checked ? cboActionPriority.SelectedValue : "NULL";
  2. var currentAssigned = chkbxActionItem.Checked ? cboActionAssignedTo.SelectedValue : "NULL";
  3.  
  4. var addJobNoteSucceeded = db.ExeSQL($"EXEC usp_JobNote @ProjectKey = {ProjectKey}, @EmpGuid = '{EBResources.EmpGuid}', @NoteType = {currentNoteTypeId}, @Title = '{txtTitle.Text}', @Note = '{txtNote.Text}', @ActionItem = {currentActionItem}, @AssignedTo = '{currentAssigned}', @PriorityKey = {currentPriorityKey}, @ChronologicalDate = '{this.dtpDate.Value}', @DesignKey = {cboDesign.SelectedValue}");
  5.  
  6. public bool ExeSQL(string sql)
  7. {
  8. bool bFlag = false;
  9. SqlCommand cmd = new SqlCommand(sql.ToString(), this.dbconn)
  10. {
  11. CommandTimeout = 0,
  12. CommandType = CommandType.Text
  13. };
  14. try
  15. {
  16. cmd.ExecuteNonQuery();
  17. bFlag = true;
  18. }
  19. catch (SqlException e)
  20. {
  21. this.HandleSQLError(e, "ExeSQL", sql);
  22. }
  23. finally
  24. {
  25. cmd.Dispose();
  26. }
  27. return bFlag;
  28. }
  29.  
  30. EXEC usp_JobNote @AssignedTo = 'NULL', @PriorityKey = NULL, @ChronologicalDate = '7/23/2019 4:24:46 PM', @DesignKey = 4031
  31.  
  32. Error converting data type varchar to uniqueidentifier.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement