Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.NET working with MS Access

ASP.NET working with MS Access

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelpquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pickron
    wrote on last edited by
    #1

    Hi there, I'm trying to figure out what the error is: System.InvalidOperationException: Parameter 0: '@Name' of type: String, the property Size has an invalid size: 0 Basically, I'm trying to populate the textboxes after I pulled down the dropdownlist and selected in the Name textbox with AutoPostBack=true. Is this error related to Access or ASP.NET code ? :confused: Thanks!

    M D 2 Replies Last reply
    0
    • P pickron

      Hi there, I'm trying to figure out what the error is: System.InvalidOperationException: Parameter 0: '@Name' of type: String, the property Size has an invalid size: 0 Basically, I'm trying to populate the textboxes after I pulled down the dropdownlist and selected in the Name textbox with AutoPostBack=true. Is this error related to Access or ASP.NET code ? :confused: Thanks!

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi there. Try setting the Size[^] property of the OleDbParameter object to something higher than 0. See if that works.

      P 1 Reply Last reply
      0
      • M Mike Ellison

        Hi there. Try setting the Size[^] property of the OleDbParameter object to something higher than 0. See if that works.

        P Offline
        P Offline
        pickron
        wrote on last edited by
        #3

        The error is gone. Now I get another error: System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. What does it mean ? :sigh:

        M 1 Reply Last reply
        0
        • P pickron

          The error is gone. Now I get another error: System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. What does it mean ? :sigh:

          M Offline
          M Offline
          Mike Ellison
          wrote on last edited by
          #4

          I think you'll want to use everything provided by the OleDbExcpetion to help troubleshoot your circumstance. This would include looking at the ErrorCode property[^], the Errors collection[^], and perhaps the InnerExcpetion[^] if available.

          P 1 Reply Last reply
          0
          • M Mike Ellison

            I think you'll want to use everything provided by the OleDbExcpetion to help troubleshoot your circumstance. This would include looking at the ErrorCode property[^], the Errors collection[^], and perhaps the InnerExcpetion[^] if available.

            P Offline
            P Offline
            pickron
            wrote on last edited by
            #5

            It seems to be a longer code for a simple web app to work with MS Access. :sigh:

            M 1 Reply Last reply
            0
            • P pickron

              Hi there, I'm trying to figure out what the error is: System.InvalidOperationException: Parameter 0: '@Name' of type: String, the property Size has an invalid size: 0 Basically, I'm trying to populate the textboxes after I pulled down the dropdownlist and selected in the Name textbox with AutoPostBack=true. Is this error related to Access or ASP.NET code ? :confused: Thanks!

              D Offline
              D Offline
              deanofharvard
              wrote on last edited by
              #6

              This may be too old school for what you're doing, but I use a regular SQL Querystring, and return using a DataReader. Just a quick pull from the DB, connection closes, all good. I can provide source, if you need it.

              P 1 Reply Last reply
              0
              • D deanofharvard

                This may be too old school for what you're doing, but I use a regular SQL Querystring, and return using a DataReader. Just a quick pull from the DB, connection closes, all good. I can provide source, if you need it.

                P Offline
                P Offline
                pickron
                wrote on last edited by
                #7

                That would be most appreciated if you can provide source. I looked at my Access database to allow Zero but I don't see Null there. I can show you my code if you'd like... I'm basically picking a name from a dropdownlist and then populate that into its textboxes from MS Access. Thanks.

                P 1 Reply Last reply
                0
                • P pickron

                  It seems to be a longer code for a simple web app to work with MS Access. :sigh:

                  M Offline
                  M Offline
                  Mike Ellison
                  wrote on last edited by
                  #8

                  Two things -- #1 - I'm not sure I understand your exasperation here. It really isn't that much code. It's a great thing that the OleDbException provides some additional properties (such as ErrorCode and Errors) to help troubleshoot problems with specific databases. It's not such a tough thing to output the values in the Errors collection, or to output the ErrorCode and perform a Google search on it. I guess the bottom line is: do you want to know what is going wrong with your database operation or not? #2 - About using Access for the backend database of a web application. Though I don't agree that it takes more code to work with Access than other databases, I do think it worth noting that there are limitations to using Access as a web backend. Access is, first and foremost, a desktop database application; though a small workgroup can work multi-user with an Access .mdb, it doesn't necessarily scale to a larger number more typical of a web application. Typically only one insert/update/delete operation may happen at a time (for other user sessions where data modification is requested through a web application, an error is triggered) because of how the .mdb file is locked when editing. For that matter, the ASPNET account requires write access to the folder containing the .mdb file so the corresponding .ldb file can be written. In the context of web applications... I think .mdb files work best as inexpensive backends for data reporting applications in small intranets, and as a simple means for distributing sample databases along with programming code (say in a CP article download). For applications requiring data modification or more robust handling of multiple users, invest in a real client/server RDBMs solution (MySQL and the MSDE are two inexpensive options). Just my 0.0248760 CAD :)

                  P 1 Reply Last reply
                  0
                  • M Mike Ellison

                    Two things -- #1 - I'm not sure I understand your exasperation here. It really isn't that much code. It's a great thing that the OleDbException provides some additional properties (such as ErrorCode and Errors) to help troubleshoot problems with specific databases. It's not such a tough thing to output the values in the Errors collection, or to output the ErrorCode and perform a Google search on it. I guess the bottom line is: do you want to know what is going wrong with your database operation or not? #2 - About using Access for the backend database of a web application. Though I don't agree that it takes more code to work with Access than other databases, I do think it worth noting that there are limitations to using Access as a web backend. Access is, first and foremost, a desktop database application; though a small workgroup can work multi-user with an Access .mdb, it doesn't necessarily scale to a larger number more typical of a web application. Typically only one insert/update/delete operation may happen at a time (for other user sessions where data modification is requested through a web application, an error is triggered) because of how the .mdb file is locked when editing. For that matter, the ASPNET account requires write access to the folder containing the .mdb file so the corresponding .ldb file can be written. In the context of web applications... I think .mdb files work best as inexpensive backends for data reporting applications in small intranets, and as a simple means for distributing sample databases along with programming code (say in a CP article download). For applications requiring data modification or more robust handling of multiple users, invest in a real client/server RDBMs solution (MySQL and the MSDE are two inexpensive options). Just my 0.0248760 CAD :)

                    P Offline
                    P Offline
                    pickron
                    wrote on last edited by
                    #9

                    Mike, I appreciate your 0.0248760 cents and a well-written post! I do want to know what and who fired the error. I don't know where to code the OldDbException so that's basically why I'm trying to figure out by debugging in step by step. It's something going on in the Open() statement whereas the database operation sneaks around! I use SQL Server at work; I use Access at home. I'd like to put the web app in my website to update the membership list, that's all. Thanks for your time to type your thoughts about Access.

                    1 Reply Last reply
                    0
                    • P pickron

                      That would be most appreciated if you can provide source. I looked at my Access database to allow Zero but I don't see Null there. I can show you my code if you'd like... I'm basically picking a name from a dropdownlist and then populate that into its textboxes from MS Access. Thanks.

                      P Offline
                      P Offline
                      pickron
                      wrote on last edited by
                      #10

                      Shall I put my code here so you can see what is wrong ? :confused:

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups