index > .NET Framework Data Access and Storage > Merging two datatables with different constraints

Merging two datatables with different constraints

I need to merge two datatables which contain different constraints.

In one datatable, there is only one primary key. But in the second table, primary key is the combination of two columns. While selecting records from the first table, I have given dummy value ("0") for the unmatched columns in the second table.

Is there any way to disable the constraints before merging the tables?




Software Engineer
krisvenki

Hi,

You can disable the constraints by using the following sentence.

dataSet.EnforceConstraints = False

You can check more about this here

Best Regards,




Diego Rojas.
Luis D. Rojas
reply 2

You can use google to search for other answers

 

More Articles

• Where to place the connection string
• Data Access Page
• Returning controlled SQL data
• Problems with running an Access macro in VS 2005
• Deny access to all my .mdb in a directory
• no option to connect system.data.oledb
• Read-only database problem after site installation
• How to import data from another database under the same server?
• Oracle Connectivity Problem
• Access to path to the database was denied
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Table Adapter update problems in Strongl
• Walkthrough: Creating a Master-Detail Wi
• Updating a DB and getting an id
• Where to place the connection string
• Can't connect to database from web servi
• ConfigurationManager.AppSettings not rea
• Problem getting schema information: Allo
• Merging datasets causes an exception wit
• How to make http connections to an MS SQ
• my sql
• MDAC Error
• Parameters.AddWithValue Output paramete
• Failed to convert parameter value from a
• ADO.Net Performance
• Calculated Column --> Using Custom Ag

Hot Articles

• Missing Schema Information of Base Table
• ComboBox, CheckBox in bound forms
• DataTable Table name
• Microsoft Oracle .NET Data Provider Perf
• TransactionScope ignores timeout option
• Client-side redirect problem
• So Many ADO Data Providers Which Should
• Database Shema Deployement
• How to import data from another database
• What is the easiest way to pass data fro
• Same Problems
• Linked tables from ASP.NET problem: OleD
• OLEDB + SQL
• GetChanges - Update - Merge result in re
• How to navigate a field in a parent table?

Recommend Articles

• Error generating a DataSet from an Oracl
• detailview "Tipi di dati non corris
• questions about Automatically Generating
• Where to store SQL server connection str
• Active Directory+Database
• Application Startup
• A problem when trying to create a SQL da
• Dynamically remove textbox
• System.NullReferenceException: Using Dat
• How to get the max length of text field
• UPdating a SQL table using dataset from
• DataTable.Load() Generates InvalidOperat
• subquery doesn't work (using VC#, *.csv,
• Problem with c# and Access DB
• vb.net and access