简体   繁体   中英

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 .

  1. Sometimes, if data exists, I can read data using sdr(sqldatareader).Read()

  2. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM