Hello All,
I have a web method in a web service as follows:
[WebMethod]
public SqlDataReader Display_test_data()
{
string connectionInfo =
ConfigurationSettings.AppSettings["ConnectionInfo"];
SqlConnection sqlconnection = new SqlConnection(connectionInfo);
sqlconnection.Open();
SqlCommand cmd_sql = new SqlCommand("select * from
Test",sqlconnection);
SqlDataReader rdr_sql = cmd_sql.ExecuteReader();
return rdr_sql;
}
This method return the error "Object reference not set to an instance
of an object" when the return type is SqlDataReader.
Instead if I have a return type as int ti work fine.
Any pointers or tips.
Regards,