How can I run a SQL query in C# statement or C# program with Linqpad?
Yes I have to mix SQL statements with Linq for compatibility reason. I use linqpad with postgres driver and these driver doesn't recognize the hstore of postgres. I already knows I can get these ignored column by using classic SQL.
You can code SQL statements in a C or C++ program wherever you can use executable statements. Each SQL statement in a C or C++ program must begin with EXEC SQL and end with a semicolon (;). The EXEC and SQL keywords must appear on one line, but the remainder of the statement can appear on subsequent lines.
Structured Query Language (SQL) is the language used in relational database management systems (RDBMS) to query, update, and delete data. SQL is a standard query language for RDBMS. SQL language's queries are also known as SQL commands or SQL statements.
You can use the ExecuteCommand
on LinqPad to run SQL statements direct on C# Statement. You can execute SQL statements with parameters formatting command string with {0}, {1}, etc.
ExecuteCommand("DELETE FROM TableOne where PrimaryKey = {0}", primaryKey);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With