Jump to content

Hi Everyone,

I'm trying to get a SQL query to work in a c# windows forms application but I keep getting data mismatch errors. I'm trying to search through records that contain the autonumber value from a different table as their foreign key so for example:

BuildingID - the primary key

BuildingName - some name 

OrgID - the foreign key I'm trying to search by

The part that I can't get to work is where I have a long variable. I have tried Single, Double and int but I can't get it to work with the query 

just for context the attached picture of the code is searching a database for information on hardware and displaying it in to a table. Then the second part is finding building name values for a combo box and it's picking these out by the OrgID value then inserting them in to the combo box. 

Sorry I can't put my code in the post for some reason even with code tags it blocks my post 

 

any help getting this working is greatly appreciated 

thatOCGuy

 

Code.JPG

Link to comment
https://linustechtips.com/topic/578119-sql-help/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×