Skip to content

Instantly share code, notes, and snippets.

@eschneider999
Last active November 22, 2016 22:42
Show Gist options
  • Save eschneider999/52c54c9a7518a2beb2c79093827e4389 to your computer and use it in GitHub Desktop.
Save eschneider999/52c54c9a7518a2beb2c79093827e4389 to your computer and use it in GitHub Desktop.
Symbiotic ORM ExecuteNonQuery
public void TestExecuteNonQuery()
{
IDatabaseTypesFactory factory = new DatabaseTypesFactorySqlServer();
factory.ConnectionString = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=D:\\Dev\\FrozenElephant\\SymbioticORM\\SqlDatabase\\SymbioticTestLocal.mdf;Integrated Security=True;Connect Timeout=30";
IObjectWriter writer = factory.CreateObjectWriter();
SqlQuerySimple sql = factory.CreateSqlQuery("update errors set errorinfo= @errorinfo where errorid= @errorid");
sql.CreateAndAddParameter(factory, DbType.String, "errorinfo", "Test: " + DateTime.Now.ToString());
sql.CreateAndAddParameter(factory, DbType.Int32, "errorid", 4);
long val = writer.ExecuteNonQuery(sql);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment