home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

"Failed to enable constraints. One or more rows contain values violating non-null, un

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2206
Discussions: 200,944, Posts: 2,379,349, Members: 246,306
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Making Health Care Worse (164)
The disrespect of Obama by Russian .. (17)
Is It Just Me? (2921)
Wireless Televisions. (11)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Regular Build (6)
Is the PSU I received dead? (11)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (9)
Install XP pro and a Vista laptop ?.. (11)
Foreign voltage (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
Recent Discussions
How to convert MP3's (2)
windows 7 internet problem (5)
Multiple Restarts Required at Boot (0)
BSOD On Startup (ntoskrnl.exe) (2)
Print spooler problem (15)
Laptop with wireless problem. (1)
Wireless Televisions. (11)
Have you switched yet? (86)
Asus P4G8X Mobo (5)
screen resolution vs monitor size (2)
radeon x850xt platinum & shader 3 (4)
sms storage to PC (0)
Regular Build (6)
Open With ..... Win7 (0)
java code for fibonacci (1)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (35)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Partition Magic caused HDD problem (3)
Is the PSU I received dead? (11)
Point and Shoot Camera Suggestions. (2)
Modern Warfare 2 freeze (13)
wireless user (1)
World's largest Monopoly Game using G.. (332)
Ideal cheap graph card for PC-Gaming? (17)


All times are GMT -4. The time now is 06:38 PM.
TechIMO Copyright 2009 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