Last active
December 16, 2015 16:18
-
-
Save slumos/5461802 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static string[] Columns(this IDataReader reader) | |
| { | |
| return Enumberable.Range(0, reader.FieldCount).Select(reader.GetName).ToArray(); | |
| } | |
| //... | |
| var columns = reader.Columns(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var columns = Enumberable.Range(0, reader.FieldCount).Select(reader.GetName).ToArray(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var columns = new string[reader.FieldCount]; | |
| for (var i=0; i < reader.FieldCount; i++) { | |
| columns[i] = reader.GetName(i); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment