How to read from a data with no column name using SqlDataReader
问题 I have Visual Studio 2013 Ultimate and creating application of WPF. I have to read the data from a SQL Server stored procedure by using SqlDataReader . Sometimes, if data exists, I can read data using sdr(sqldatareader).Read() But in the case when no data exists, I just select 'false' in stored procedure but I don't know how to read that string with having no column name by SqlDataReader . 回答1: You can do this. reader.GetString(0); //0 stands for "the 0'th column" 来源: https://stackoverflow