Sql Server 2005 里的语句在VB里如何写?Sql Server 2005 里的语句如:
     select * from 学生情况表 where 姓名 = 李小龙,爱好 = 武术
     Select pub_id,pub_name,country From publishers                 '从出版社表中检索出所有的出版商代号,出版商名字,以及国籍
     Select * From publishers      '从出版社表中检索出所有的列
     Select Top 10 * From Customers            '从Customers表中返回前10行数据
     Select Top 10 Percent * From Customers            '从Customers表中返回前10%的数据
     Select Distinct country From publishers                        '过滤重复的国家名
     Select Distinct city state From authors                        '选出州名和城市名完全相同的作家
     Select 总统名 + "." + 夫人名, city + ",  " + country From 总统
     Select title_id,type,price,price-price*0.5 From titles 
     ......我只知道一些简单的Sql语句在VB里的写法如:
    Adodc2.RecordSource = "select * from publishers"其他复杂的SQL语句在VB里如何写我就不知道了,望大虾们指点指点,谢谢了 

解决方案 »

  1.   

    Adodc2.RecordSource = "select * from  学生情况表 where 姓名='" & text1.text & "'" 
      

  2.   

    精确查询
    Adodc2.RecordSource = "select * from  学生情况表 where 姓名='" & text1.text & "'" 
    模糊查询
    Adodc2.RecordSource = "select * from  学生情况表 where 姓名 like '%" & text1.text & "%'" 
      

  3.   

    精确查询
    Adodc2.RecordSource = "select * from  学生情况表 where 姓名='" & text1.text & "'"
    模糊查询
    Adodc2.RecordSource = "select * from  学生情况表 where 姓名 like '%" & text1.text & "%'"
      

  4.   

    SQL语句查询都是标准的,只是每个开发工具的调用方法有所不同