I am trying to populate an infragistics web data grid with 3 or 4 datasets. Specifically, creating a SQL String and populating a dataset, then merging that dataset to a master dataset. When I am done I will bind the web grid to the master dataset. Here's what I mean:
On the second merge I keep getting the error “Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.”. So I threw the .merge into a Try block and wrote out “dtmaster.Constraints.Count” and I got 0. Am I actually violating the constraints on the tables in the database? I noticed there was a .Remove method, but I don’t want to change the db at all. Will calling the Remove method actually delete the constraint from the db? If anyone can help me fill this danged grid with info please let me know.
Thanks,
-- Joe --
Code:
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = ConnStr
oOracleConn.Open()
Dim tmpdt As New DataTable
Dim dtMaster As New DataTable
SqlStr = "Select PtName as Data, PtType as Type Where PtNo = “ & ptno
Dim oCmd As New OracleCommand(SqlStr, oOracleConn)
Dim oClinicalReader As OracleDataReader = oCmd.ExecuteReader
tmpdt.Load(oClinicalReader)
dtMaster.Merge(tmpdt)
tmpdt.Dispose()
tmpdt = New DataTable
SqlStr = "Select ProcNo as Data, ProcType as Type Where PrNo = “ & ptno
oCmd.CommandText = SqlStr
oClinicalReader = oCmd.ExecuteReader
tmpdt.Load(oClinicalReader)
dtMaster.Merge(tmpdt)
tmpdt.Dispose()
‘*** 3 – 4 More Sql Statements and Merges
dtClinical.DataSource = dtMaster
dtClinical.DataBind()
On the second merge I keep getting the error “Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.”. So I threw the .merge into a Try block and wrote out “dtmaster.Constraints.Count” and I got 0. Am I actually violating the constraints on the tables in the database? I noticed there was a .Remove method, but I don’t want to change the db at all. Will calling the Remove method actually delete the constraint from the db? If anyone can help me fill this danged grid with info please let me know.
Thanks,
-- Joe --