{
connection.Open();
cmd = connection.CreateCommand();
cmd.CommandText = "SELECT Project.ProjectId,Project.ProjectName,BidTable.BidId
FROM (BidTable LEFT JOIN Project ON BidTable.ProjectId=Project.ProjectId)
WHERE BidTable.SubContractorId=@sid ORDER BY BidDate DESC";
cmd.Parameters.Add("@sid", SqlDbType.NVarChar, -1);
cmd.Parameters["@sid"].Value = IDNumber.ToString();
reader = cmd.ExecuteReader();
while (reader.Read())
{
//get data here
}
}
by the left join i am getting all records from BidTable whether there
is a match or not with Project table.