TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SIVA
NA
742
706.5k
How to fetch child records from DataRelation class
Dec 23 2011 5:09 AM
Hi All,
i have established the connection between two tables using
DataRelation class as follows. & i have two gridviews
for parent table primary key column in Gridview i have link button.
now my requirement is
when i click the DNo in parent gridview by using DataRelation it have to fetch the child records & i have to display those records in another gridview
oCon=
new
SqlConnection
(
ConfigurationManager
.AppSettings[
"conStr"
]);
oDADept =
new
SqlDataAdapter
(
"select * from tbl_Department order by DNo"
,oCon);
oDAEmp =
new
SqlDataAdapter
(
"select * from tbl_EmpDept order by ENo"
, oCon);
oDS =
new
DataSet
();
oDADept.Fill(oDS,
"tbl_Department"
);
oDAEmp.Fill(oDS,
"tbl_EmpDept"
);
oDR =
new
DataRelation
(
"DeptEmp"
, oDS.Tables[
"tbl_Department"
].Columns[
"DNo"
], oDS.Tables[
"tbl_EmpDept"
].Columns[
"DNo"
]);
oDS.Relations.Add(oDR);
Reply
Answers (
2
)
Paypal IPn not working in website
How to make selected index zero for dropdownlist in java script..?