این متد است:
public static dynamic GetFactorProperties(int factornumber)
{
using (var db = new OleDbConnection(cs))
{
db.Open();
var cmd = new OleDbCommand("SELECT * FROM FactorList WHERE FactorNumber = @0", db);
cmd.Parameters.AddWithValue("@0", factornumber);
var result = cmd.ExecuteReader();
if(result.Read())
{
return result ;
}
else
{
return ProperiesObject();
}
}
}
public static dynamic ProperiesObject()
{
dynamic obj = new ExpandoObject();
obj.FactorDate = string.Empty;
obj.FactorNumber = string.Empty;
obj.CustomerName = string.Empty;
obj.FactorPrice = string.Empty;
obj.Discount = string.Empty;
return obj;
}
var result = Program.GetFactorProperties(factornumber);
TXTDate.Text = result.FactorDate;
TXTFactorNumber.Text = result.FactorNumber;
TXTCustomerName.Text = result.CustomerName;
TXTFactorParice.Text = result.FactorPrice;
TXTDiscount.Text = result.Discount;:
پیغام خطا:
> Additional information: 'System.Data.OleDb.OleDbDataReader' does not
> contain a definition for 'FactorDate'