A question abt master detail forms
-
hello every one, well I'm working on making a master detail form here. I've binded the data correctly and now I want to add the update, del, and insert new record functionality to the detail form. I'm using .net 2.0 C# and I'm working in windows Forms. I've used DataGridView class to display the detail data information. For saving the record, I wanted to cast the datasource of DataGridView into a datatable first and then use it to iterate thru the data but it returns a null so I get the nullreferenceException. Plz tell me how to iterate thru the detail table here. I actually deleted a few columns from the detail table ;like the PK columns and Foreign Key columns coz the user doesnt need to see those. But I do wanna have access to those esp when updatin the record. So what can I do. if its possible plz give me a sample code or application if u can. thanks in advance... Rocky
-
hello every one, well I'm working on making a master detail form here. I've binded the data correctly and now I want to add the update, del, and insert new record functionality to the detail form. I'm using .net 2.0 C# and I'm working in windows Forms. I've used DataGridView class to display the detail data information. For saving the record, I wanted to cast the datasource of DataGridView into a datatable first and then use it to iterate thru the data but it returns a null so I get the nullreferenceException. Plz tell me how to iterate thru the detail table here. I actually deleted a few columns from the detail table ;like the PK columns and Foreign Key columns coz the user doesnt need to see those. But I do wanna have access to those esp when updatin the record. So what can I do. if its possible plz give me a sample code or application if u can. thanks in advance... Rocky
You have to add both the tables in a dataset and then add realtionship to the priamry and foreign keys of these tables in DataSet.Relations. 2nd thing, dont delete those colunms, just make them invisble to user or make them read only.
sorry for my bad English.
-
You have to add both the tables in a dataset and then add realtionship to the priamry and foreign keys of these tables in DataSet.Relations. 2nd thing, dont delete those colunms, just make them invisble to user or make them read only.
sorry for my bad English.