Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL command with "INNER JOIN" in .net

Status
Not open for further replies.

soldieryap

Programmer
Aug 15, 2000
59
MY
i tried a sql command in MS Access and it work properly but when i tried to put it in commandtext in vb.net (of course modified some to suit vb code), it had problems. how's that happened?? is that vb.net doesn't support it? thanks for answer me.

example : SELECT bread.[bread id], bread.Name, factory.ID, factory.name FROM bread INNER JOIN factory ON bread.[bread id] = factory.[bread id]
 
I don't claim to know much about SQL but wouldn't the following work? I have never been a fan of the INNER JOIN just seems rather complicated when this works just as well.

SELECT bread.[bread id], bread.Name, factory.ID, factory.name
FROM bread, factory
WHERE bread.[bread id] = factory.[bread id]


Not sure that this is really answering your question though. What is commandtext? Is it a DB command object? That'l do donkey, that'l do
[bravo]
 
Hi soldieryap,

The syntax of your SQL statement is valid. So, I'm wondering if it's something else. What is the error you're getting?

Regards, MapMan [americanflag]

Assume nothing, question everything, be explicit not implicit, and you'll always be covered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top