title: How I can convert DateTime.now in C# to yyyy-mm-dd hh:mm:ss.sssssss?
body: <p>I'm storing in my database using a store procedure the date time stamp using a function called <code>sysdatetime()</code> and a type of <code>varchar(max)</code> which stores in the database in this format <code>yyyy-mm-dd hh:mm:ss.sssssss</code>. When I'm creating a new post its fine but when I'm trying to update the record I have to send a parameter to the store procedure with the current <code>datetime</code>. I have tried this one</p>
  
  <pre><code>DateTime.Now.ToString(yyyy-mm-dd hh:mm:ss.sssssss)
  </code></pre>
  
  <p>but I'm getting an error. what i have to do?</p>
  
  <p>P.s: see the image below with the error message </p>
  
  <p><img src="https://i.stack.imgur.com/riYIk.png" alt="enter image description here"></p>