-2

I want to build SQL query and save it to the text file. I need it to execute that query later. DbCommand can create valid SQL query, but how can I take the string representation of the query to save to file? Or maybe there is another way to build SQL and save it to string?

gustav
  • 119
  • 13

1 Answers1

1

while debugging, you can right click on the property and select "Add Watch".

Now in you watch window you see the Name & Value. Copy the Vlaue to clipboard and you can use it to your liking.

Aldert
  • 4,209
  • 1
  • 9
  • 23
  • I operate with 1000+ insert-statements. So, it is not good solution – gustav Dec 15 '18 at 11:23
  • Then in code store the SQL query to the file, link: https://stackoverflow.com/questions/6153074/how-do-i-write-data-to-a-text-file-in-c – Aldert Dec 15 '18 at 11:25