SqlDataAdapter Problem Overload

Discussion in 'ASP .Net Datagrid Control' started by jm, Oct 14, 2003.

  1. jm

    jm Guest

    This code:

    <%@ Page Language="vb" %>
    <%@ import Namespace="System.Data" %>
    <%@ import Namespace="System.Data.Odbc" %>
    <%@ import Namespace="System.Data.SqlClient"%>
    <script runat="server">

    Sub Page_Load(Sender As Object, E As EventArgs)

    Dim DS As DataSet
    Dim MyCommand As SqlDataAdapter

    Dim MyConnection As Odbc.OdbcConnection
    Dim sConnString As String = "Dsn=test;" & _
    "Uid=root;" & _
    "Pwd="



    MyConnection = New Odbc.OdbcConnection(sConnString)

    MyCommand = New SqlDataAdapter("select * from users",
    MyConnection)

    DS = new DataSet()
    MyCommand.Fill(ds, "users")

    MyDataGrid.DataSource=ds.Tables("users").DefaultView
    MyDataGrid.DataBind()
    End Sub

    </script>
    <html>
    <head>
    </head>
    <body>
    <h3><font face="Verdana">Simple Select to a DataGrid
    Control</font>
    </h3>
    <ASP:DataGrid id="MyDataGrid" EnableViewState="false"
    HeaderStyle-BackColor="#aaaadd" Font-Size="8pt" Font-Name="Verdana"
    CellSpacing="0" CellPadding="3" ShowFooter="false" BorderColor="black"
    BackColor="#ccccff" Width="700" runat="server"></ASP:DataGrid>
    </body>
    </html>


    Gives this error:


    Compiler Error Message: BC30518: Overload resolution failed because no
    accessible 'New' can be called with these arguments:

    Source Error:



    Line 19: MyConnection = New Odbc.OdbcConnection(sConnString)
    Line 20:
    Line 21: MyCommand = New SqlDataAdapter("select * from users",
    MyConnection)
    Line 22:
    Line 23: DS = new DataSet()


    What does this mean? Why doesn't it like these arguments? How can I
    fix it? Thank you for any help.
     
    jm, Oct 14, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. zhaoJian
    Replies:
    0
    Views:
    1,052
    zhaoJian
    Nov 6, 2003
  2. Randy Smith
    Replies:
    0
    Views:
    659
    Randy Smith
    Apr 28, 2005
  3. =?Utf-8?B?Q2FpbGlu?=
    Replies:
    0
    Views:
    1,619
    =?Utf-8?B?Q2FpbGlu?=
    Sep 9, 2005
  4. Piotre Ugrumov
    Replies:
    3
    Views:
    392
    Nick Hounsome
    Jan 25, 2004
  5. Ying-Chieh Liao

    function overload (not operator overload)

    Ying-Chieh Liao, Oct 11, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    277
    Sherm Pendley
    Oct 11, 2004
Loading...

Share This Page