Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のように、Dapper でストアド プロシージャを実行しています。
var sprocResult = conn.Query("TestSproc", new {clientID = 2}, commandType: CommandType.StoredProcedure).ToList();
結果を列挙して値を一覧表示できます。私ができる必要があるのは、sproc から返されるフィールド名を列挙することです。これらのフィールド名は設計時にはわかりません。
前もって感謝します。
クエリが行を返さない場合、 はQuery().First().Keys機能しません。この場合、使用できますExecuteReader().GetName(i)。
Query().First().Keys
ExecuteReader().GetName(i)