Questions tagged [rawsql]
95 questions
-1
votes
1 answer
EF Core 3.1, how to use raw sql on a database with PostgreSQL (npgsql) or any other than SQL Server
For the code
public object GetRawSqlResult(string request)
{
object result = ctx.Database.ExecuteSqlCommand(request);
return result;
}
I get this error for ExecuteSqlCommand:
CS1061: 'DatabaseFacade' does not contain a definition for…

Eric Ouellet
- 10,996
- 11
- 84
- 119
-1
votes
1 answer
Is there any way to use raw sql or i'm stuck with laravel-eloquent?
I'm trying to migrate an application developed in 2007 and add and api to it so I can easy develop and sync data with the new App I started a laravel project with the old database just to create the api the old database diagram look like this: Too…
-1
votes
1 answer
Raw sql query in laravel not working, shows some error
When I tried to replace laravel query builder with raw sql query, it displays some errors.
Query:
$users = DB::select('select * from action_buttons where action_button_id BETWEEN 98 AND 102');
On executing the above query the following error…

Syam Suthan
- 1
- 1
-1
votes
2 answers
How to populate an entity model using EF raw SQL queries and/or LinQ?
I want to populate the entity model below:
public class MyModel
{
public Abc Abc { get; set; }
public Def Def { get; set; }
public List Ghi { get; set; }
}
public class Abc
{
[Key]
public int ID { get; set; }
…

Tomo
- 429
- 1
- 10
- 24
-2
votes
1 answer
Django placing of WHERE in raw SQL query
The order of the WHERE in this query was wrong, but it is correct now.
postModel = list(PostModel.objects.raw(
SELECT max(pub_date),
count(topic_id) AS freq,
count(DISTINCT author) AS contributors
FROM crudapp_postmodel
WHERE author…

Shane G
- 3,129
- 10
- 43
- 85