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;
}
Loading
Pradeep ChandrakerPosted Jun 23, 2011, 3:46 AM
Mike JonsonPosted Jun 23, 2011, 3:40 AM
Mike JonsonPosted Jun 23, 2011, 3:38 AM
Pradeep ChandrakerPosted Jun 23, 2011, 3:36 AM
Mike JonsonPosted Jun 23, 2011, 3:19 AM
Pradeep ChandrakerPosted Jun 23, 2011, 2:53 AM
idDebitor = Guid.NewGuid().ToString()
Mike JonsonPosted Jun 23, 2011, 2:42 AM
I entered manually this number in debitorID: 12321234-1232-1232-2343-343432783562
Pradeep ChandrakerPosted Jun 23, 2011, 2:19 AM
Suthish NairPosted Jun 23, 2011, 2:16 AM
Am not sure, string idDebitor this must be a int datatype in DB Table and you are passing string value.
Can you explain, what you are doing. Any insertion happening before for this select statement?