Re:.NET 5.0
by mattmanser on Tuesday November 10, 2020 @07:35PM
(#25054131)
using(var conn = new SqlConnection("<conn-string>"))
using(var cmd = new SqlCommand(@"Query here", conn))
{
conn.Open();
cmd.executeNonQuery();
}
Re:.NET 5.0
by FridgeSeal on Wednesday November 11, 2020 @12:26AM
(#25055735)
Hmmmm, maybe I am just dense hahaha.
Their own documentation for making queries against SQL Server doesn't provide examples of how to do it that aren't using DI. "Just inject it" it just says. Thanks .net, super helpful. Maybe the docs are there, but I couldn't find them at all when I went looking.