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
Bhavesh Jadav
NA
1.2k
17.8k
Webchase data was changed after execute LINQ query.
Sep 21 2018 7:04 AM
Hello friends,
I faced issue to get original data from Web cache/Session/Tempdata which I store on it.
I have two data set dsProducts and dsSearchdata.
dsProducts > table1 having 200 rows
dsSearchdata > table1 having 500 rows and table2 having 300 rows.
Now I store dsSearchdata on Webcache/Session/Tempdata.
Now I perform LINQ on between both DataSet Tables and get filer rows from dsSearchdata.
Take filer table and store it on the dataset of its index, at that time original data are changed from Web cache/Session/Tempdata.
Code Snippet:
Session[
"MapData"
] = dsSearchdata;
// dsSearchdata is DataSet
for
(
int
i = 1; i < dsSearchdata.Tables.Count; i++)
{
var mapping = (from tbl1 in dsSearchdata.Tables[i].AsEnumerable()
join tbl2 in dsCategoryProducts.Tables[0].AsEnumerable()
on tbl1.Field<
int
>(
"ProductId"
) equals tbl2.Field<
int
>(
"ProductId"
)
select tbl1).CopyToDataTable();
if
(mapping.Rows.Count > 0)
{
DataTable dt =
new
DataTable();
dt = mapping;
dsSearchdata.Tables[i].Clear();
dsSearchdata.Tables[i].Merge(dt,
true
);
}
// Here if I check my original data on Session["MapData"] then it was changed as per the result of the above query.
}
I don't know what's happening, please help me.
Thanks.
Reply
Answers (
0
)
How to change Headline in Linq
How to get same Items Exist in two Datatables in third datat