Skip to content

Instantly share code, notes, and snippets.

@pachecoder
Created December 8, 2012 20:55
Show Gist options
  • Save pachecoder/4241887 to your computer and use it in GitHub Desktop.
Save pachecoder/4241887 to your computer and use it in GitHub Desktop.
fillParametersDinamically
protected override void fillParametersDinamically(System.Data.IDbCommand com, Object[] args)
{
for (int i = 1; i < com.Parameters.Count; i++)
{
var p = (System.Data.SqlClient.SqlParameter)com.Parameters[i];
p.Value = i <= args.Length ? args[i - 1] ?? DBNull.Value : null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment