Link to home
Start Free TrialLog in
Avatar of JDL129
JDL129

asked on

Query problem in XSD in C#

Hey guys another problem.

The following code in a table adapter:
SELECT     MemberID, FirstName, Middle, LastName, RoleID, MemberStatusID, GoesByName, FamilyCode, WorkStatusID, EmployerID, UseFamilyAddress,
                      Address, Address2, City, State, ZipCode, HomePhone, HomeFaxPhone, HomeCellPhone, HomeEMail, WorkPhone, WorkFaxPhone, WorkCellPhone,
                      WorkEMail, MailLabelLine1, MailLabelLine2, OccupationID, Sex, Student, Retired, MemberShipDate, Anniversary, Birthday, BaptizedDate,
                      MaritalStatus, BloodType, ProjectedGraduationDate, InvolvementFormDate, Notes, LastUpdate
FROM         tblMember
WHERE  (FirstName LIKE @fname) ORDER BY LastName

gives errors of: Error in where clause near '@'
                         Error in where clause near 'ORDER'

I have the exact same type of query in another program that uses the same WHERE clause and it works perfectly.

Any help would be appreciated!!

Jerry
Avatar of sameer_goyal
sameer_goyal
Flag of India image

Are you providing the value to the parameter @fname in your C# code?

If yes, can you post how?
ASKER CERTIFIED SOLUTION
Avatar of tigin44
tigin44
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JDL129
JDL129

ASKER

Thanks for the post guys!!
I might not have made this clear but the is a sql from a table adapter.  I have another program that my code works perfectly in but it seems that in this program I can't use a variable.  Is there some setting I'm missing?

Thanks guys!!

Jerry
Avatar of JDL129

ASKER

Thanks for the help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!