المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : search for a word in other ********s



C# Programming
04-27-2010, 12:31 AM
Hey guys, I have a problem, I run a code in sqlQuesry builder and it works just fine but when I apply the same thing in C# code it doesn't work !!! http://www.barakasoft.com/script/Forums/Images/smiley_doh.gif

in SQLQuery Builder
SELECT ID, StuName,
StuLName, Shenasnameh, StuLandline, StuMobilePhone,
StuEmail, StuAddress
FROM Students WHERE StuName like N'ک?وان%'
the above code works perfectly and I get the result I want but the below code doesn't
SELECT ID, StuName,
StuLName, Shenasnameh, StuLandline, StuMobilePhone,
StuEmail, StuAddress StuEmail, StuAddress FROM Students WHERE StuLName
like N'" + StuLName_tb.Text + "%'";

I'm puzzled here because It the same code, am I missing something ??? http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif