F
Franck Diastein
Hi, when I call ExportData I have this error:
Invalid attempt to Read when reader is closed.
Telling me that there's a problem with this line:
while(_dataR.Read()){
Code:
*************************************************
public void Export2CSV(){
SqlDataReader _dataR = ExportData();
while(_dataR.Read()){
//using data
}
}
private SqlDataReader ExportData(){
//Data extraction from database
return myDataR;
}
*************************************************
Invalid attempt to Read when reader is closed.
Telling me that there's a problem with this line:
while(_dataR.Read()){
Code:
*************************************************
public void Export2CSV(){
SqlDataReader _dataR = ExportData();
while(_dataR.Read()){
//using data
}
}
private SqlDataReader ExportData(){
//Data extraction from database
return myDataR;
}
*************************************************