ASP.NET working with MS Access
-
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!
-
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!
-
-
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:
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. -
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. -
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!
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.
-
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.
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.
-
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 :)
-
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 :)
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.
-
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.