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
.
你可以这样做。
reader.GetString(0); //0 stands for "the 0'th column"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.