Try this, it's a little clearer:
List<customer> customers = new List<customer>();
con.Open();
using (SqlCommand cmd = new SqlCommand("Select Id, CompanyRefId from SalesMan where salesmanname=@salesmanname and code=@usercode", con))
{
cmd.Parameters.AddWithValue("@salesmanname", salesmanname);
cmd.Parameters.AddWithValue("@usercode", usercode);
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
customer c1 = new customer();
c1.id = (int) reader["Id"];
c1.companyrefid = (Guid) reader["CompanyRefId"];
customers.Add(c1);
}
}
Provided your SQL table contains the two columns "Id" and "CompanyRefId", and they are INT and UNIQUEID respectively, you need no other conversion.