我有用SQL, dim str as string="select au_fname,au_lname,pub_name from authors,publishers where authors.city=publishers.city"dim comm1 as new oledbcommand(str,objconn) dim adapter1 as new oledbadapter(comm1) dim dataset1 as new dataset adapter1.fill(dataset1,"?")
adapter1.fill(dataset1,"A1") A!是你自己给dataset中的数据表取的名字,就是将select au_fname,au_lname,pub_name from authors,publishers where authors.city=publishers.city搜索出来的数据集放到DataSet中名为A1的数据表中。如果你直接用adapter1.Fill(dataset1),既没有给他一个表名,系统也会给你默认生成一个表名,如Table,Table1
dim str as string="select au_fname,au_lname,pub_name from authors,publishers where authors.city=publishers.city"dim comm1 as new oledbcommand(str,objconn)
dim adapter1 as new oledbadapter(comm1)
dim dataset1 as new dataset
adapter1.fill(dataset1,"?")
A!是你自己给dataset中的数据表取的名字,就是将select au_fname,au_lname,pub_name from authors,publishers where authors.city=publishers.city搜索出来的数据集放到DataSet中名为A1的数据表中。如果你直接用adapter1.Fill(dataset1),既没有给他一个表名,系统也会给你默认生成一个表名,如Table,Table1