Mike Jonson

Mike Jonson

  • NA
  • 239
  • 193.6k

Operand type clash: uniqueidentifier is incompatible with numeric

Jun 23 2011 2:01 AM
I have create next Method and every time error: Operand type clash: uniqueidentifier is incompatible with numeric. I vant undestand why. Please help.

public object GetCredits(string idDebitor)
        {
            ArrayList allCredits = new ArrayList();

            using (SqlConnection con = new SqlConnection(conectionString)) //???????????? ? ??
            {
                string query = string.Format("select * from Credits where DebitorID={0}", idDebitor);
                SqlCommand com = new SqlCommand(query, con); //??????? ???????? ???????
                //try
                {
                    con.Open(); //????????? ??????????

                    SqlDataReader dr = com.ExecuteReader(); //????????? ?????? ?? ??????? ? ?????????? dr
                    if (dr.HasRows) //???? ??????? ?? ??????, ????????? ? ??????
                        foreach (DbDataRecord result in dr)
                            allCredits.Add(result);
                }
                //catch
                { }
            }
            return allCredits;
        }




Answers (9)