Tag: SqlDataReader
How to get the column names from a SqlDataReader in C#?
There are times when you might want to connect to a database and then get all the column names that was returned in the SqlDataReader object. How to get the column names from a SqlDataReader in C#? Here’s a code snippet demonstrating how to do it.
How to Check for Column Name in SqlDataReader object in C# ?
Do you want to check if a column exists in a SqlDataReader instance in C# ?. One of the simplest solution is to navigate to all the fields within the data reader and check the name of the field using the GetName method as shown below. How to Check for Column Name in SqlDataReader object in C# ?