<%@Import namespace="System.Data.OleDB"%>
这里错了.sql库不是用OleDB

解决方案 »

  1.   

    <%@Import namespace="System.Data.SqlClient"%>
    应该是这个.sql库.
      

  2.   

    <%@Import namespace="system.data"%>
    <%@Import namespace="System.Data.SqlClient"%>
    <script language="vb" runat=server>
    sub page_load(source as object,e as eventargs)
    dim objConn as oledbconnection
    dim strConn as string
    strConn="provider=SQLOLEDB;datasource=192.168.2.16;database=exame;user id=example;pwd=example;"
    objConn=new Sqlconnection(oleconnstr)
    dim olecommand as new oledbcommand
    objConn.open
    end sub
    </script>
      

  3.   

    Provider=sqloledb;Data Source=192.168.2.16;Initial Catalog=exame;User Id=example;Password=example;