i have written the following code in my business logic and it is producing some error like are u missing using directive or assembly function. But i have check the references for many time and not able to get why this error is coming. the following is my BAL code:
using Datalgc;
using DL;
namespace Buss
{
public class BusinessLogic
{
GenralFunction gf = new GenralFunction();
public class property
{
private string _Name;
private int _DOB;
private string _Add;
private int _Phno;
private string _Country;
private string _State;
private string _Distt;
public string Name
{
get { return _Name; }
set { _Name = value; }
}
public int DOB
{
get { return _DOB; }
set { _DOB = value; }
}
public string Add
{
get { return _Add; }
set { _Add = value; }
}
public int Phno
{
get { return _Phno; }
set { _Phno = value; }
}
public string Country
{
get { return _Country; }
set { _Country = value; }
}
public string State
{
get { return _State; }
set { _State = value; }
}
public string Distt
{
get { return _Distt; }
set { _Distt = value; }
}
}
public DataTable userdetails()
{
DataTable dt = new DataTable();
dt = gf.Filldatatablevalue(null, "spuserdetails", dt,null);
return dt;
}
public int Insert()
{
int result = 0;
SqlParameter[] parameters = new SqlParameter[7];
parameters[0] = new SqlParameter("@Name", SqlDbType.VarChar, 4)
{ Value = Name };
parameters [1] = new SqlParameter("@DOB", SqlDbType.Datetime, 2)
{ Value = DOB };
parameters[2] = new SqlParameter("@Addr", SqlDbType.VarChar, 3)
{ Value = Addr };
parameters[3] = new SqlParameter("@phn", SqlDbType.Int, 2)
{ Value = phn};
parameters[4] = new SqlParameter("@Country", SqlDbType.VarChar, 2)
{ Value = Country };
parameters[5] = new SqlParameter("@State", SqlDbType.VarChar, 70)
{ Value = State };
parameters[6] = new SqlParameter("@City", SqlDbType.VarChar, 70)
{ Value = City };
result = gf.UpdateData(parameters, "spuserdetails");
return 0;
}
}
}
also
Value = Name
and etc in insert method are showing error that Name does not exist in the current context. also after adding the namespace of BAL (here Buss to my codebehind file i m not able to use the properties. what i have done in .cs file is as follows:
BusinessLogic obj = new BusinessLogic();
and with this object i want to assingn values to the properties but can't. Why? Help me .Thanks.