Last active
November 22, 2016 22:42
-
-
Save eschneider999/52c54c9a7518a2beb2c79093827e4389 to your computer and use it in GitHub Desktop.
Symbiotic ORM ExecuteNonQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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