数据查询问题!
有Book和Owner两个表,Book表中的数据包括{“BookCode”,“BookName”,“BookPrice”,“BookOutDate”},Owner表中的数据包括{“BookCode”,“OwnerName”,“OwnerDate”},现在查询满足txtQuery中输入Text的BookCode,将查询出的Book表的“BookCode”,“BookName”,“BookPrice”,“BookOutDate”以及Owner表中的“OwnerName”,“OwnerDate”都在datagridview1中显示,如何实现,谢谢各位大虾了!!
------解决方案--------------------select a.BookCode, a.BookName, a.BookPrice, a.BookOutDate, b.OwnerName, b.OwnerDate
from Book as a
inner join Owner as b on a.BookCode= b.BookCode
where a.BookCode = '你输入的串 '
------解决方案--------------------1、SQL问题有问题
strOleDb = "select a.[Code],a.[Name],b.[UseID],b.[UserDate] from Book as a inner join Owner as b on a.[Code] = b.[Code] where a.[Code]= ' "+strQuerystrQuery+ " ' "
2、具体程序实现请到相应的语言版块去问吧。