title: Get the parameter prefix in ADO.NET
body: <p>I want to generate several SQL statements based on a column list using the column names as parameters.</p>
  
  <p><strong>Edit</strong>: C#</p>
  
  <pre><code>var columns = new string[] { "COL1", "COL2" };
  var tableName = "TABLE_1";
  var prefix = "@"; // TODO get this from the provider factory
  
  string sqlInsert = string.Format(
      "INSERT INTO {0}\n( {1}) VALUES\n({2})",
      tableName,
      string.Join(",  ", columns),
      string.Join(", ", columns.Select(c =&gt; prefix + c)));
  </code></pre>
  
  <p>Generated SQL:</p>
  
  <pre><code>INSERT INTO TABLE_1
  ( COL1,  COL2) VALUES
  (@COL1, @COL2)
  </code></pre>
  
  <p>This works with the SqlClient. But I'm using the abstract classes in System.Data (<code>DbCommand</code>, <code>DbParameter</code>, etc.) and different data providers such as Oracle, MySQL, Postgres etc based on the connection string settings in the app.config. Thus I need to know which prefix I have to use. For MS-SQL it is the <code>@</code>, Oracle uses the <code>:</code>, the rest I actually don't know.</p>
  
  <p>Is there a way to get this prefix character from the provider factory?</p>
  
  <p><code>System.Data.SqlClient.SqlClientFactory.Instance</code>doesn't have such an information or at least I couldn't find it.</p>
  
  <p>Otherwise, can you give me a list for the common databases?</p>
  
  <p><strong>Edit</strong>: The target platforms are .NET 2 to .NET 4 and the information should be available through the provider factory.</p>