Good day Guys. I want to display the value of Townhouse into txthouse after selecting code from the data Thank you guys .
DataTable dtRefItem = Common.Common.GetData("SELECT Townhouse FROM County where code= '"+txtbox.text"'"
A DataTable normally contains multiple DataRows. Even if you select only one you need to access that row from it's DataTable.Rows-property.
string townHouse = null;
if(dtRefItem.Rows.Count > 0)
{
townhouse = dtRefItem.Rows[0].Field<string>("Townhouse");
}
txthouse.Text = townHouse;
Common.Common.GetDataexactly do? And looks like you need to use+aftertxtbox.textlike'" + txtbox.text + "'"