“/vbdonet”应用程序中的服务器错误。
--------------------------------------------------------------------------------不支持关键字: “provider”。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.ArgumentException: 不支持关键字: “provider”。源错误: 
行 12:           Dim MyCommand As SqlDataAdapter
行 13: 
行 14:           MyConnection = New SqlConnection("User ID=sa;Data Source=192.168.1.105;password=78519275;Initial Catalog=pubs;Provider=SQLOLEDB.1")
行 15:           MyCommand = New SqlDataAdapter("select * from Titles where type='" + Category.SelectedItem.Value + "'", myConnection)
行 16: 
 源文件: E:\wdq2\vbdonet\index.aspx    行: 14 堆栈跟踪: 

解决方案 »

  1.   

    有asp,asp.net各种数据库的连接方式
      

  2.   

    colinliu(流浪人) :顺便问一下用那种方式连接效率更高谢谢
      

  3.   

    <script language="vb" runat="server">
    public ds as new dataset()
    public n as integer
    public sqlstr as string="select * from jianli" 
    public connstr as string="server=jmj;database=khweb;uid=sa;pwd=sa"
    public da as new sqldataadapter(sqlstr,connstr)
    sub page_load(sender as object,e as eventargs)
    if not Page.IsPostBack  then
    if session("cno")=nothing then
    Response.Write("<script>alert('您的身份不明确,请重新登陆!')</"+"script>")
    response.Redirect("index.aspx")
    elseda.fill(ds,"members")
    rcount.text = ds.Tables(0).Rows.Count
    nno.text=5
    ds.Clear()
    da.fill(ds,0,5,"members")
    response.Write(rcount.text)
    r1.databind()
    end if
    end if
    end sub
    sub readpage(sender as object,e as eventargs)dim n as integer
    n=nno.text
    da.fill(ds,n,5,"members")
    if rcount.text>=n then
    nno.text=n+5
    else
    nxt.Enabled="false" 
    end if
    response.Write(rcount.text)
    r1.databind()
    end sub
    </script>