I want to read the content in datareader.So I use below coding to do that
if (dataReader4.IsDBNull(0)){
}
but I run above coding it gave me an error meassage.The error Meassage is
"Invalid attempt to read when no data is present".
then I use below coding
dataReader4["Email"]==null
but It also gave me above error meassage.There is no record for that field,that only for one record,for othere records there are email address.
Hi,
Read example here . It will help you. You have to call dataReader4.Read() before reading it. If still problem persist please post code what you have done so far.
I want to read the content in datareader.So I use below coding to do that
if (dataReader4.IsDBNull(0)){
}
but I run above coding it gave me an error meassage.The error Meassage is
"Invalid attempt to read when no data is present".
then I use below coding
dataReader4["Email"]==null
but It also gave me above error meassage.There is no record for that field,that only for one record,for othere records there are email address.
Thanks
Tank50
//****************************************************
Hi,
try this code to read datareader...// Instance a new object
Object a = new Object();
// Check if datareader is null
if (datareader == null)
return;
// Get data from datareader
while (datareader.Read())
{
// Code example...
a = datareader.GetValue(0);
}