title: ScriptingOptions sql smo does not support scripting data
body: <p>I'm generating sql database script using c# code.</p>
  
  <p>following code works fine for <code>create table</code> but when I try to use <code>scriptOptions.ScriptData = true;</code> it is throwing following exception.</p>
  
  <blockquote>
    <p>An unhandled exception of type
    'Microsoft.SqlServer.Management.Smo.FailedOperationException' occurred
    in Microsoft.SqlServer.Smo.dll</p>
    
    <p>Additional information: This method does not support scripting data.</p>
  </blockquote>
  
  <p>code</p>
  
  <pre><code> public static string ScriptDatabase(string dbConnectionString, string databaseName)
          {
  
              SqlConnection conn = new SqlConnection(dbConnectionString);
              ServerConnection serverConn = new ServerConnection(conn);
              var server = new Server(serverConn);
              var database = server.Databases[databaseName];
  
              var scripter = new Scripter(server);
             // I tried this code also       
             // scripter.Options.ScriptData = true;
              ScriptingOptions scriptOptions = new ScriptingOptions();
              scriptOptions.ScriptDrops = false;
              scriptOptions.ScriptData = true;
              scriptOptions.ScriptSchema = true;
  
  
              scriptOptions.IncludeIfNotExists = true;
              string scrs = "";
              string tbScr = "";
              foreach (Table myTable in database.Tables)
              {
                  /* Generating IF EXISTS and DROP command for tables */
                  StringCollection tableScripts = myTable.Script(scriptOptions);
                  foreach (string script in tableScripts)
                      scrs += script + "\n\n";
  
                  /* Generating CREATE TABLE command */
                  tableScripts = myTable.Script();
                  foreach (string script in tableScripts)
                      tbScr += script + "\n\n";
              }
   return (scrs + "\n\n" + tbScr);
  }
  </code></pre>