我想從一組行查詢行中讀取數據,並將每個記錄放入對象列表中的一個對象中,但我不知道單個記錄的數據類型是什麼在SqlDataReader中。SqlDataReader [i]數據類型
List<Response> responseList = new List<Response>();
for (int i = 0; reader.Read(); i++) //reader is the SqlDataReader
responseList.Add(new Response(reader[i]));
什麼數據類型我設置Response
構造函數的參數作爲?
public Response(IDataRecord r) //what's the data type suppose to be?
{
}
你試過檢查您的直接窗口讀者[I] .GetType()? – user15741