Radzen generates application with Entity Framework. All CRUD operations are listed in a service using EF methods for insert, update, delete and read - there is no built-in way to execute raw SQL. If you still think this is what you want you can create custom method in your page and use EF FromSqlRaw method:
Hello Chrisl,
One possible solution if you dont want to use EF it's this one:
in your .cs file of your razor page you need to create a method like this:
Public mymethod (myparameters....if needed)
{
string connectionstring="myconnectionstring .............................."
using (SqlConnection con = new SqlConnection(connectionstring))
{
using (SqlCommand cmd = new SqlCommand("", con))
{
cmd.CommandText=" your update query";
cmd.ExecuteNonQuery();
}
}
}
with radzen create a button and in the Click event you can select "call custom method".
Hello, I am not expert of Radzen , probably @korchev can confirm you better. but from my test it works perfectly . the trick is to create a Method in the .cs file and call it from the radzen component.
the SQL part it is the same that i wrote you before. I already use it and it works very fast. dont forget to add the using Microsoft.data , or system.data . best regards . Leo