Programming

SQL Stored Procedure in .NET Core

SQL stored procedure in .NET Core. I call SQL stored procedures slightly differently in .NET Core to the way I did in .NET framework as I now pass the connection string through as an argument and I need to remember to add the System.Data.SqlClient NuGet package. public static List<string> GetBlogSummaries(string Read more…

Programming

SQL Stored Procedure In .NET

I generally end up forgetting how to return results from a SQL stored procedure within .NET so I figured I’d put it here for reference. public static List<Blog> GetBlogSummaries() { List<Blog> blogs = new List<Blog>(); using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings[“BlogDatabase”].ConnectionString)) { using (SqlCommand command = new SqlCommand(“sp__get_blog_summaries”)) { command.CommandType Read more…