Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 January 4th, 2005, 01:17 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default OleDbParameter Problem

I'm trying to use the example on page 308 where I add the @firstName and @lastName parameter to the dbCommand, but when I execute the insert statement (dbCommand), I get the following error:
"Exception Details: System.Data.OleDb.OleDbException: Must declare the variable '@firstName'".

Incidentally, I'm also having trouble using the try/catch code.

Thanks for any help.
 
Old January 12th, 2005, 03:28 PM
Registered User
 
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you please post your code?

 
Old January 12th, 2005, 03:51 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I've fixed the problem. I just changed to SqlClient and got it running. I was using OleDb since the example in the book used it, but I'm talking to SQLServer anyway.

Thanks again.










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