How do I execute a SQL statement with parameters in ServiceStack.OrmLite?

yo2011

I want to execute SQL statement with paraemeters in ServiceStack ormlite

String.Format("SELECT OBJECT_ID(@name)", name);

I want the best way.

Rosdi Kasim

If you need the POCO result you can use:

List<Person> results = db.SqlList<Person>("SELECT * FROM Person WHERE Age < @age", new { age=50});

Reference: https://github.com/ServiceStack/ServiceStack.OrmLite#typed-sqlexpressions-with-custom-sql-apis

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to do a GroupBy statement with ServiceStack OrmLite

How do I use the servicestack ormlite JoinSqlBuilder

How do I increase the Command Timeout in OrmLite ServiceStack?

How to use ServiceStack OrmLite Sql.Count

Sql in ormlite servicestack

How do I escape special characters when using ServiceStack OrmLite with SQLite?

How do I join 2 tables in ServiceStack OrmLite and select both classes?

How do I execute a proper IF-THEN statement?

How can I read the PRAGMA from SQLite using ServiceStack OrmLite?

Using SQLAlchemy to execute an SQL statement with named parameters

How can I execute this sql statement with .NET and Dapper.NET?

Convert SQL to ServiceStack.ORMLite Sql Server

How do I execute a stored procedure without parameters in JDBC?

How do I execute Javascript with parameters using wkWebView in Objective C?

How do I convert this SQL to prepared statement?

How do i express this sql statement in mongodb

In SQL, how do I write a "IN" statement for string?

How do I use a SQL If statement here?

How do I view a SQL Statement in Phalconphp?

how do i create a proper in statement with sql?

How can I do a self join in ORMLite

How do I pass parameters between components in a React switch statement?

Redis caching with ServiceStack OrmLite and SQL Server persistence

Persisting Nodatime Instant in SQL Server with ServiceStack / OrmLite

How do I convert the following SQL Statement to an Update Statement

In an loop, how do I execute a statement once when it is true, and then execute it again once when it is true again?

How do I make an if statement not execute and go to the else if statement if one or more variables are less than 0?

ServiceStack ORMLite How to fparse JSON data in Query

How can I get a list of entities from existing data with ServiceStack.OrmLite?

TOP Ranking

HotTag

Archive