can somebody tell me how does data reader work in following list
and what will the result of............if(dr.Read())..

public List<clsproductprp> RetFind_rec(clsproductprp prp1)
            SqlDataReader dr=null;
            List<clsproductprp> obj = new List<clsproductprp>();
            SqlCommand discmd = new SqlCommand();
                if (con.State == ConnectionState.Closed)

                discmd.CommandText = "spFindFromProduct";
                discmd.CommandType = CommandType.StoredProcedure;
                discmd.Connection = con;
                discmd.Parameters.AddWithValue("@fanProductid", prp1.productidprp);
                dr = discmd.ExecuteReader();

                    clsproductprp prp = new clsproductprp();
                    prp.productnameprp = dr["Producname"].ToString();
                    prp.Quantityperunitprp = Convert.ToInt32(dr["Quantityperunit"].ToString());
                    prp.unitinStockprp = Convert.ToInt32(dr["unitinstock"].ToString());
                    prp.unitPriceprp = Convert.ToInt32(dr["unitPrice"].ToString());
                    prp.productidprp = Convert.ToInt32(dr["Productid"].ToString());
            catch { }
            return obj;

A datareader runs one way, it is fast and very good for printing out info. So with your if(dr.Read()) if the datareader has rows then this code will print out the first row of data to your variables.

btw: It is good pratice to check to see if the reader has rows before you try to read.

Actually function moves the pointer of the datareader to the next record and also returns true if it exists.Initially, the reader does not point to anything. It is only after you call that is points to the first record and then you can read the data. Without calling that it will give error.
In your case if have also checked its return value in the "if" condition.
I guess there is 1 record. for more records, u have to use while(
Hope u get it.