Hi,
Do it this way:
select
count(al.email) as total_likes
, r.*
, s.s_name
, c.category_name
, sc.subcategory_name
,CASE iam WHEN 1 THEN 'Professional/Business' ELSE 'Individual' End as iamdetail
,substring(description,1,250) AS shortdescription
,substring(title,1,30) AS shorttitle, substring(address,1,80) AS shortaddress
FROM tbl_adregister r
inner join tbl_adlike al on r.ad_id=al.ad_id
INNER JOIN tbl_state s ON r.state = s.s_id join tbl_category as c on r.category=c.category_id
INNER JOIN tbl_adsubcategory sc on r.ad_id=sc.ad_id
where country=@country and category=@category and al.ad_id=r.ad_id
This may not work, what I am trying to say here is.. add your new column in the previous query only.
Now, you are writing two datatables and obviously you can bind to only on. Hence, the field you are writing is not available to bind, and you get this error