-
September 8th, 2013, 02:44 PM
#1
display two columns only
Hello Listeners,
I created a SL application (using C#) that returns contents of a table in SQL database. Table has 5 columns (FirstName, LastName, Age..etc).
--A grid is populated with following:
EclipseMTXDomainContext context = new EclipseMTXDomainContext();
dataGrid1.ItemsSource = context.DBTables;
context.Load(context.GetDBTablesQuery());
--Mine domain service has an entry as follows:
public IQueryable GetDBTablesCompare() {
return this.ObjectContext.DBTables;
}
This works fine but
What I am trying to do now is load only two columns at a time so I added this in the domain services
public IQueryable GetTwoColms(string db1,string db2) {
return this.ObjectContext.DBTables.Where(P => P.col1Name == cl1 && P.col2Name == cl2);
}
--And the main program, added this to a button action
EclipseMTXDomainContext context = new EclipseMTXDomainContext();
dataGrid1.ItemsSource = context.DBTables;
context.Load(context. GetTwoColms Query("LastNames","FirstName"));
It does not fail but it does not return anything either.
Any help is greatly appreciated
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|