Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2007, 10:20 PM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default OleDb Provider installed, but probem still persis

Hi, I have installed a MySQL OleDb Provider after receiving the message " InvalidOperationException: The 'MySQLProv' provider is not registered on the local machine." The version of OleDb Provider that I installed was 3.9.6 -debug. My application was supposed to upload a file to a MySQL database when a button is clicked. I had read in one of the sites that talk about OleDb that one could fix the problem I've experienced by installing an OleDb Provider. That's exactly what I've done and I've also imported everything needed to use OleDb, but I still have the same problem. If you can tell me what else I need to do to resolve this problem I'll be very grateful. Below is my code , thank you in advance for your help.

Imports System.IO
Imports System.Data.OleDb
Public Class Upload
    Inherits System.Web.UI.Page

strFileExtension = Right(txtFileContents.PostedFile.FileName, 4)
            Select Case strFileExtension.ToLower
                Case ".doc"
                    StrFileType = "doc"
                Case ".ppt"
                    StrFileType = "ppt"
                Case ".htm"
                    StrFileType = "htm"
                Case ".html"
                    StrFileType = "html"
                Case ".txt"
                    StrFileType = "txt"
                Case Else
                    StrFileType = "jpg"
            End Select
            'Grab the content of uploaded file
            intFileLen = txtFileContents.PostedFile.ContentLength
            Dim arrFile(intFileLen) As Byte
            objStream = txtFileContents.PostedFile.InputStream
            objStream.Read(arrFile, 0, intFileLen)


            'Add UpLoaded file to a database
            myConnection = New OleDbConnection("Provider=MySQLProv; Data Source=Data;User Id=myID;Password=myPWD")
            strInsert = "INSERT into QUsers (docTitle,docContent,docDate,docType)values (FileTitle,FileContent,FileType)"
            cmdInsert = New OleDbComman(strInsert,myConnection)
            cmdInsert.Parameters.Add("@FileTitle", txtFileTitle.Text)
            cmdInsert.Parameters.Add("@FileContent", arrFile)
            cmdInsert.Parameters.Add("@FileContent", DateTime.Now.ToShortDateString())
            cmdInsert.Parameters.Add("@FileType", StrFileType)
            cmdInsert.ExecuteNonQuery()
            myConnection.Close()
            cmdInsert.ExecuteNonQuery()
            myConnection.Close()
        End If

    End Sub
End Class






Similar Threads
Thread Thread Starter Forum Replies Last Post
JSTL String comparison probem! Plzzz help !! shimmeringtrinkets JSP Basics 0 February 26th, 2008 10:05 AM
installed DataSet Template tjordan43 ASP.NET 2.0 Basics 1 January 7th, 2008 01:00 AM
wdproj is NOT installed www2006 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 September 12th, 2007 12:11 AM
.net could not be installed quetzalcoatl VS.NET 2002/2003 0 December 23rd, 2003 12:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.