public void GetOffice(int syncID)
{
string strQry = @"
Select so.SyncID,
so.title
From Offices o
Left Outer Join SyncOffices so On so.id = o.SyncID
Where o.SyncID = @syncID
";
using (SqlConnection conn = new SqlConnection(Settings.ConnectionString))
{
using (SqlCommand objCommand = new SqlCommand(strQry, conn))
{
objCommand.CommandType = CommandType.Text;
objCommand.Parameters.AddWithValue("@syncID", syncID);
conn.Open();
SqlDataReader rdr = objCommand.ExecuteReader();
if (rdr.Read())
{
this.OfficeName= rdr.GetString(1);
}
rdr.Close();
}
}
}
Return Office Details From Multiple Tables
ADH
- 336
- 4
- 15