Home > Forum > ASP.NET > this code is working all right,but i want to write it in three tier architecture with DAL,BAL logic

this code is working all right,but i want to write it in three tier architecture with DAL,BAL logic

by abhinav singh   on Feb 06, 2014   Category: ASP.NET  |  Views: 1039    |  Points: 5   |  Starter 
  Reply
my code


if (e.Row.RowType == DataControlRowType.Header)
{

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["db_absql"].ConnectionString);
conn.Open();

using (var GetArea1 = new SqlCommand("SELECT Area1,Area2 FROM tb_MPropertyCategory WHERE id=@ID", conn))
{
GetArea1.Parameters.AddWithValue("@ID", Convert.ToInt32(DdlPropType.SelectedValue));
using (SqlDataReader dr = GetArea1.ExecuteReader())
{
if (dr.Read())
{
((Label)e.Row.FindControl("lblArea1") as Label).Text = dr.GetString(dr.GetOrdinal("Area1"));
((Label)e.Row.FindControl("lblArea2") as Label).Text = dr.GetString(dr.GetOrdinal("Area2"));

}

}

}

}

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 


  No response found, be the first to answer this question.


Recent Post

Latest Posts