C# abstraction and database layer
问题 I am wondering what's a better way to abstract some of this code, into a simple DAL. At this time, I'm just patching the code and don't have time or need yet to use EF, Linq2Sql or any ORM right now. public string GetMySpecId(string dataId) { using (SqlConnection conn = new SqlConnection(this.MyConnectionString)) { conn.Open(); // Declare the parameter in the query string using (SqlCommand command = new SqlCommand(@"select ""specId"" from ""MyTable"" where ""dataId"" = :dataId", conn)) { //