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: 2623
Discussions: 200,520, Posts: 2,374,498, Members: 245,842
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
Is It Just Me? (1660)
FT HOOD attack: 7 killed 12 injured (70)
HELP!!! What do you think of this s.. (25)
windows 7 retail and rtm (5)
Review My Build (6)
Looking for a graphic card that wil.. (30)
My 1st pc build (40)
PC Modern Warfare 2: it's much wors.. (12)
core i7 extreme 975, nvidia 9400gt (9)
Building my first computer (13)
Aero in Vista (7)
[F@H SPAM 11/1/09]New month . . . n.. (34)
Internet very slow since updating A.. (10)
slaving laptop drive (7)
Recent Discussions
[F@H SPAM 11/08/09] Where has all the.. (1)
nvidia geforce 9500GT 1gig DDR2 (3)
[F@H SPAM 11/1/09]New month . . . new.. (34)
Endless BSOD to Recovery Manager loop.. (0)
HELP!!! What do you think of this sys.. (25)
New Processor, Monitor will not turn .. (3)
Determining ip route and serial addre.. (8)
can u beat freecell # 1941? (11)
Dell 8300 Graphics Problems (1)
I have words with double underlines a.. (2)
Internet very slow since updating AVG.. (10)
My Pc wont start after i interupted D.. (0)
windows 7 retail and rtm (5)
New processor technical problem (0)
boot from CD-ROM in chipset via P4M80.. (2)
Powe Director v8 (0)
Windows Experience Index is screwed u.. (3)
Review My Build (6)
FAT32 to NTFS file system in Win2kpro (4)
Motherboards and my curse... (25)
2009 Build (4)
My 1st pc build (40)
Freezing During Music/Movies (1)
ext. sound card laptop to stereo syst.. (2)
Remote Desktop via SSH and error mess.. (2)


All times are GMT -4. The time now is 03:20 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