Results 1 to 2 of 2

Thread: Type 'OdbcConnection' is not defined.

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Type 'OdbcConnection' is not defined.

    Can someone tell me what is wrong with this line of code (*):

    When I use this in a code behind page it is fine but when I try with inline coding I get the following error message :

    Type 'OdbcConnection' is not defined.

    Here is the code :

    <script language="VB" runat="server">

    Sub Page_Load(Src As Object, E As EventArgs)
    * Dim myConn As OdbcConnection = New OdbcConnection("driver={MySql};uid=root;pwd=;server=127.0.0.1;database=mybase;OPTION=17923")
    myConn.open
    dim command as string = "Select * from tblMicrosites"
    dim ds as new dataset()
    dim adaptor as odbcdataadaptor = new odbcdataadaptor(command, connect)
    dim cmdbuilder as odbccommandbuilder(adaptor)
    adaptor.fill(ds)
    dim i as integer
    for i = 0 to ds.tables(0).rows.count - 1
    ds.tables(0).rows(i).item(3) = "test"
    end
    adaptor.updatecommand = cmdbuilder.getupdatecommand()
    adaptor.update(ds.table(0))
    End Sub

    </script>
    </html>

    Thanks in Advance

    Parksie

  2. #2

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    Before anyone asks this code is at the top of the page :

    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="microsoft.Data.odbc" %>
    <%@ Import Namespace="microsoft.Data" %>

    <html>

    Parksie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width