Guest User

Untitled

a guest
Feb 12th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. public int NewFunction(int UserID, string fName, string fDescription, string connectionStr)
  2. {
  3. OracleConnection connection = new OracleConnection(connectionStr);
  4. try
  5. {
  6. //PLease Note that User ID and fDescription are passed into the function as
  7. //parameters
  8. connection.Open();
  9.  
  10. OracleCommand command = connection.CreateCommand();
  11.  
  12. OracleTransaction transaction = connection.BeginTransaction();
  13. command.Transaction = transaction;
  14. string LoadedFileName = @WfName;//Fd.FileName;
  15. //read the xaml content from file
  16. command.CommandText = "INSERT INTO XYZ(ID, NAME , F_SCRIPT) VALUES (@UserID, @fDescription, EMPTY_CLOB())";
  17.  
  18. command.ExecuteNonQuery();
  19. transaction.Commit();
  20. }
  21.  
  22. command.CommandText = "INSERT INTO XYZ(ID, NAME , F_SCRIPT) VALUES (@UserID, @fDescription, EMPTY_CLOB())";
  23.  
  24. command.CommandText = "INSERT INTO XYZ(ID, NAME , F_SCRIPT) VALUES (:UserID, :fDescription, EMPTY_CLOB())";
  25. command.Parameters.Add("UserId", OracleType.Number).Value = userId;
  26. command.Parameters.Add("fDescription", OracleType.NVarChar).Value = fDescription;
Add Comment
Please, Sign In to add comment