SqlFunction fails to open context connection despite DataAccessKind.Read present
问题 I've got a SqlServer project with a very simple test for a Table-Valued-Function:- [SqlFunction(TableDefinition = "forename nvarchar(50)", FillRowMethodName = "TestFillRow", DataAccess = DataAccessKind.Read)] public static IEnumerable TestConn(int ID) { using (SqlConnection con = new SqlConnection("context connection=true")) { //con.Open(); yield return "Anthony"; } } public static void TestFillRow(object obj, out string forename) { forename = (string)obj; } Note the Open on the connection is