-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: PSingh
Message 1 in Discussion

Hi,      I have a dataset loaded with 2 tables. First table is a parent table and the 
other one is child. My parent table has a composite primary keys. Now, i need to 
create the dataRelation object using these composite keys. I tried using the following 
code.    
Dim objParentCol(2) As String 
Dim objChildCol(2) As String 
objParentCol(0) = dts.Tables(0).Columns("Problem_Id").ColumnName 
objParentCol(1) = dts.Tables(0).Columns("Solution_Id").ColumnName 
objChildCol(0) = dts.Tables(1).Columns("Problem_Id").ColumnName 
objChildCol(1) = dts.Tables(1).Columns("Solution_Id").ColumnName objR = New 
DataRelation("SolutionAttach", objParentCol,objChildCol)    It gave me an error saying 
"Parameter Column cannot be null". But all the required fields were properly 
populated. Then i changed the code to     
objR = New DataRelation("SolutionAttach", "Solution", "Attach", objParentCol, 
objChildCol, True) 
With this line, it created the relation object. But when i used this to add to the 
relations collection of dataset using 
dts.Relations.Add(objR) 
it gave me an error message saying "object reference not set to an object". 
Can anyone help me on this. 
Regards, 
Pradeep.

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to