You can for example enter the length and width of the web (VS.NET2005), when it runs out of range index error exception was unhandled by user code for chieudai
Code:
public class Tinh
{
private Int32 _quanhuyen;
private String _diachiNha;
private Double _chieudai;
private Double _chieurong;
private Double _dientichDat;
}
public Int32 Quanhuyen
{
get { return _quanhuyen; }
set { _quanhuyen = value; }
}
public String DiachiNha
{
get { return _diachiNha; }
set { _diachiNha = value; }
}
public Double Chieudai
{
get { return _chieudai; }
set { _chieudai = value; }
}
public Double Chieurong
{
get { return _chieurong; }
set { _chieurong = value; }
}
public Double DientichDat
{
get { return _dientichDat; }
set { _dientichDat = value; }
}
private Tinh DienTich(IDataReader dr, bool GetTotalRecords)
{
Tinh obj = new Tinh();
obj.Quanhuyen = (dr["Quanhuyen"] is DBNull) ? Int32.MinValue : (Int32)dr["Quanhuyen"];
obj.DiachiNha = (dr["DiachiNha"] is DBNull) ? String.Empty : (String)dr["DiachiNha"];
// bottom line this error index out of range exception was unhandled by user code
obj.Chieudai = (dr["Chieudai"] is DBNull) ? Double.MinValue : (Double)dr["Chieudai"];
obj.Chieurong = (dr["Chieurong"] is DBNull) ? Double.MinValue : (Double)dr["Chieurong"];
obj.DientichDat = (dr["DientichDat"] is DBNull) ? Double.MinValue : (Double)dr["DientichDat"];
if (GetTotalRecords)
obj.TotalRecords = (dr["TotalRecords"] is DBNull) ? -1 : Globals.ConvertToInt32(dr["TotalRecords"]);
return obj;
}
because you see help, or advice fixes