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
Marc Moineau
NA
8
524
C# with Linq not working
Dec 15 2020 7:44 PM
Good day All,
I'm new here I just started programming in C# not to long ago.
I'm building a little project connected to an SQL database and I'm not able to get the Result that I want I always get the length in the DataGrid.
I have a ComboBox with a listing. When selecting from the drop-down I take the Value and get the Partner_tb.PartnerKey from it. then I try to get a listing from the Document_tb based on the PartnerKey.
I always get 1 column with the length if I show the partnerKey.toString(). but the value should look like "MarcCyn"
Here's the code I have :
public
void
partnerBox_SelectionChanged(
object
sender, SelectionChangedEventArgs e)
{
var partnerKey = from pn
in
dataContext.Partner_tbs
where pn.PartnerName == PartnerBox.SelectedValue.ToString()
select pn.PartnerKEY;
var documentName = from Document_tb
in
dataContext.Document_tbs
join Partner_tb
in
dataContext.Partner_tbs
on Document_tb.PartnerKEY equals Partner_tb.PartnerKEY
where Partner_tb.PartnerKEY == partnerKey.ToString()
select
new
{ Document_tb.PartnerKEY, Document_tb.DocumentName, Document_tb.TransactionSetID, Document_tb.ControlNumber } ;
list997.ItemsSource = documentName;
}
I would really appreciate any help on this.
Thanks in advance.
Marc
Reply
Answers (
2
)
To map local TABLE FIELDS with API columns c#
Map table columns with API fields having different name