Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 July 30th, 2007, 05:03 AM
Registered User
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in insert query ?

I have the database in access and i have created the connection, command in oledb when i am trying to execute the command i getting error like
"Parameter @invoiceno has no default value."
let me know what should be done ?


Insert into newsales(invoiceno,customercode) values(@invoiceno,@customercode)"

 
Old July 30th, 2007, 08:03 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You need to provide a value for the variables in the query. You can do it like this:

OleDbCommand.Parameters.Add(new OleDbParameter("variablename", value))

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Into Query. rupen Access VBA 5 July 30th, 2007 09:58 AM
Where does insert query go? bph Access VBA 5 June 12th, 2007 12:26 PM
Insert query problem. -- Solved rupen Classic ASP Basics 5 May 15th, 2007 08:59 AM
I solved insert query.now see this Update Query. [email protected] VB.NET 2002/2003 Basics 2 September 21st, 2006 12:48 AM
Database access from java, INSERT query problem nitusincog BOOK: Beginning Java 2 1 July 21st, 2003 10:26 AM





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