|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
[Net1.1SP1][OledbCommand]I'm doing a WebService using ASP.NET with an Access database. Nothing really fancy, I just want to try and see what I can get to. Using an Access database(no please, don't tell me that MS is pushing towards MSDE, since I'm going to have a hoster so no luck with it). I'm trying to use parameters and looking on Google Groups I found out that I have to use question marks(?) for parameters. So far so good, I mean, no problems in using unnamed parameters, this service isn't complicated so - well - I can live with this :-) But if I'm here, then it's likely there's a problem... and indeed there's one, since the "parameters" collection of the OleDBCommand doesn't get updated. Sigh. The source of my problem likely relies in the SQL statement I'm writing, which should be like this: Insert Into FAQS values(Question,Answer) That I've translated into: Insert Into FAQS values(?,?) But as I said, parameters collection doesn't fill in with the two items and I'm clueless about what to do. Any ideas? Cheers, Andrew Andrea Raimondi wrote:
> Any ideas? Googling some more I found this:http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/browse_frm/thread/6c22bd12f2059181/dd6c09b064c289c1?lnk=st&q=adonet+oledb+parameters&rnum=16#dd6c09b064c289c1 (watch out link wrap), will let you know. Andrew Andrea,
Yesterday I have tried to make a sample that fullfils the most problems that I have seen in this newsgroup with OleDB and Access. The problem is that it is become therefore an extended sample. One of the main thing with OleDB and Access is that the name of the parameter is from not any importantcy. The sequence of use accoording as they are in the SQL string is what has to be done. As well have you sometimes to give one more parameter than needed at the end. I have not yet find why. It is a windowsform sample, however in fact is the form only to show the results, it could have been as well aspnet. http://www.vb-tips.com/default.aspx?ID=87057b89-a61c-44b9-bbfa-f80b8e80394e It is brand new, so if you think that I made errors, than please reply those. There are by the way more simpler tips with OleDbParameters on our website. I hope this helps, Cor |
|||||||||||||||||||||||