Wrox Programmer Forums
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x 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 March 25th, 2008, 05:29 AM
Authorized User
 
Join Date: Dec 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection Error

I am getting an error.
Error reads "ExecuteNonQuery:Connection property has not been initialized"

This happens when i am INSERTING data into a database.
Code looks like this:

constr = "INSERT INTO TABLE values(......)"
concmd = New OleDbCommand(constr, con)
count = concmd.ExecuteNonQuery

Please help.

 
Old March 25th, 2008, 07:26 AM
Authorized User
 
Join Date: Sep 2007
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And con is ... exactly what? OleDbConnection object? Has it been instantiated or is it null?
 
Old March 27th, 2008, 04:56 AM
Authorized User
 
Join Date: Dec 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

con is the OleDbConnection.
I have found what the error was.
My con is in a file which was not called.
Now that the file is called we are able to connect.

Thanks

 
Old April 4th, 2008, 12:46 AM
Registered User
 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

asp






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection Error kingroon Classic ASP Basics 3 January 10th, 2008 08:48 PM
Connection Error zaghmout ASP.NET 2.0 Professional 3 October 31st, 2007 01:55 AM
connection error jigsy ADO.NET 1 May 22nd, 2007 08:00 AM
connection error janees ASP.NET 2.0 Professional 1 March 2nd, 2007 02:26 PM
Connection Error: Please Help code_lover ADO.NET 3 February 6th, 2007 10:12 PM





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