home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2762
Discussions: 188,385, Posts: 2,243,516, Members: 232,615
Old March 3rd, 2003, 03:56 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Oct 2002
Posts: 71
"Failed to enable constraints. One or more rows contain values violating non-null, un

"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints." string





Hi!

I get this error when I excetute this code

(error on line: m_dataAdapter.Fill(m_dsCarTrade,"CustomerAddress")


also I get one error in one Row:

<error: an exception of type: {System.Data.StrongTypingException} occurred>

(Tables have a relationship to eachother)


Code:
		private OleDbDataAdapter m_dataAdapter;

		private OleDbConnection m_accessConnection;

		private OleDbCommand m_accessCommand;


		private	const string m_conStrAccessConnection  = "provider=Microsoft.JET.OLEDB.4.0; " + 
													   "data source = C:\\Visual Studio Projects\\" +
													   "CarTrade\\CarTradeDB.mdb";	

                private const string m_conStrSelectCommandCustomer = "SELECT Customer.*, CustomerAddress.* FROM Customer INNER JOIN CustomerAddress ON Customer.CustomerID = CustomerAddress.CustomerID";


		private void LoadFreshCustomersFromDB()
		{
			//we create an access object
			m_accessConnection = new OleDbConnection(m_conStrAccessConnection);
			m_accessCommand = new OleDbCommand(m_conStrSelectCommandCustomer, m_accessConnection);
			m_dataAdapter = new OleDbDataAdapter(m_accessCommand);

			//we open the connection to DB
			m_accessConnection.Open();

			try
			{
				m_dataAdapter.Fill(m_dsCarTrade,"CustomerAddress");

				m_dataAdapter.Fill(m_dsCarTrade,"Customer");

			}
			catch (Exception e)
			{
				MessageBox.Show("Sorry....but we have some problems with database. " + "Error message from database : " + e.Message,"ERROR!!!");

			}
			finally
			{
				//we close the connection to DB
				m_accessConnection.Close();
			}

			m_dtCustomers = m_dsCarTrade.Tables["Customer"];
		}
Know someone why this error caused?



gicio

gicio is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2898)
CPU wont boot (7)
3-days in and no threads about Gaza (160)
I think I just killed my computer w.. (24)
hp compaq nc6000 problems (139)
Upgrading RAM (5)
Folderchat Weekday thread (442)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (15)
Recent Discussions
New Build ( Finally ) (3)
CPU wont boot (7)
Problem With LightScribe DVD Dr.. (0)
GLaDOS is up. (3)
HP notebook reinstall Vista NO .. (5)
Building a gaming computer advi.. (4)
hp compaq nc6000 problems (139)
Folderchat Weekday thread (442)
Creative T-3000 Subwoofer (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 11:08 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28