check if record exist
-
What is the best way to check for a record exists in a database using linq to sql? I want to check if a userid (int) and typeid (int) exist. - The following code always returns zero even if the record exists - what is the best approach? int result = 0 result = (from t in context.customers where ((t.userid == intUserID) && (t.typeid == intTypeID)) select t).Count();
-
What is the best way to check for a record exists in a database using linq to sql? I want to check if a userid (int) and typeid (int) exist. - The following code always returns zero even if the record exists - what is the best approach? int result = 0 result = (from t in context.customers where ((t.userid == intUserID) && (t.typeid == intTypeID)) select t).Count();
Why do you need Linq to SQL for such a basic task ? This is what I feared, new tools are being forced like square pegs into round holes by people with no idea. And, this is a SQL question. A very basic one, at that.
Christian Graus Driven to the arms of OSX by Vista. Please read this[^] if you don't like the answer I gave to your question. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.