• Jose Arvelo

    Jose Arvelo - 2003-04-10

    What am I doing wrong?
    I get the following error message:
    Type: 'MySQLDriverCS.MySQLDataReader' has no constructors.
    For the source error it highlights line 15 where I dim db_datareader as new mySQLDatareader


    <%@ Page Language="VB" Debug="true" CompilerOptions='/R:"C:\Program Files\MySQLDriverCS\dll\MySQLDriverCS.dll"'  %>

    <%@ import Namespace="System" %>

    <%@ import Namespace="MySQLDriverCS" %>

    <script runat="server">

        Dim db_mySQLConn as MySQLConnection = new MySQLConnection(new MySQLConnectionString("localhost","vcbmatrix","root","").AsString)


        Sub Page_Load(sender as Object, e as EventArgs)


        end sub

        sub mySQLbind()

            dim strSQL as string = "select * from employees;"

            dim db_sqlCommand as new mySQLCommand(strSQL, db_MySQLConn)


            dim db_sqlReader as new mySQLDatareader

            db_sqlReader = db_sqlCommand.executereader


            dgEmployees.datasource = db_sqlReader



        end sub


    <%@ import Namespace="MySQLDriverCS" %>





        <form runat="server">

            <asp:Label id="lblConnectionStatus" runat="server" Width="511px">Label</asp:Label>

            <asp:DataGrid id="dgEmployees" runat="server"></asp:DataGrid>





    Any input is greatly appreciated.

    • Anonymous - 2003-06-11

      You probably know this by now but the reader should be referred like this:
        dim db_sqlReader = db_sqlCommand.executereader

      instead of:
        dim db_sqlReader as new mySQLDatareader
        db_sqlReader = db_sqlCommand.executereader


    • Anonymous - 2003-06-11

      ...or so I figure, since I have never used VB.NET but only C# coming from the Java world...

      In C# it would be:
      mySQLDataReader myReader = db_sqlCommand.ExecuteReader();

      Just in case the first post was bullshit to you VB folks out there...

    • Sven Dummis

      Sven Dummis - 2003-06-12

      The Datareader needs to be reffered in VB.NET like this:

      dim db_sqlReader as mySQLDatareader

      db_sqlReader = db_sqlCommand.executereader

      The NEW you can only use if there is a constructor in the class. The MySqlDataReader doesn't have one. The DataReader will be "constructed" by calling MySQLCommand.executeReader() or MySQLCommand.executeReaderEx()


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks