I have a table and I want to load a combobox in silverlight using LINQ-to-SQL Classes.
Table-
| ID | FName |
| 1 | Keyur |
| 2 | Nishant |
I have to compulsarily use System.Collection.Generics - eg - list.
My Linq Query - var fnames = from names in TblNames select new { names.FName};
I am getting an error in using IList Interface.
Please help me out..
Thank You all in advance !!
Riddhi ValechaPosted Nov 9, 2012, 11:29 PM
I am still having issues in loading combo box in silverlight dynamically.
My requirement is -
There is a Silverlight Page(.xaml file), Class file(class1.cs file), Service file(svc.cs file).
I have written the [OperationContract] in Service file(svc.cs file).
I have written the EventHandlers and Listeners and Methods in Class file(class1.cs file).
There are 2 methods: 1)CheckLogin() and 2)FillData().
And finally, invoked the method in Silverlight Page(.xaml file).
There is no error. But during debugging, the control goes to the CheckLogin() after debugging FillData() method.
And the combo box is not loaded.
Please help me out.
Riddhi ValechaPosted Nov 8, 2012, 1:01 AM
I have taken your code...
Started solving and debugging it...
I'll try and complete it by today itself....
Posted Oct 13, 2012, 9:24 AM
[email protected]
Santhosh Kumar JayaramanPosted Oct 13, 2012, 8:01 AM
http://www.c-sharpcorner.com/UploadFile/1a81c5/silverlight-application-with-mvvm-wcf-and-entity-framework/
Riddhi ValechaPosted Oct 13, 2012, 6:58 AM
I did your code in a new silverlight project !! It worked....
But the SilverlightServiceReference is not getting updated and hence, I am not able to make the event handlers to load the combo box...
To update the ServiceReference, I did a right click on the servicereference and clicked Update Service Reference.
Still not working !!!
Thanks !!!
Santhosh Kumar JayaramanPosted Oct 13, 2012, 12:15 AM
Riddhi ValechaPosted Oct 13, 2012, 12:13 AM
The linq query is -
var result = from users in context.Tbl_FirstName select users.FName;
Santhosh Kumar JayaramanPosted Oct 12, 2012, 8:50 AM
But you are returning list of string.
public List
{
try
{
context = new ComplaintManagementSystemDataClasses1DataContext();
return context.Tbl_FNames.ToList() ;
}
catch (Exception err)
{
err.Message.ToString();
return null;
}
}
Riddhi ValechaPosted Oct 12, 2012, 8:47 AM
I have to write a method in WCF Service in silverlight as below:
public List
{
try
{
context = new ComplaintManagementSystemDataClasses1DataContext();
var comtypes = from types in context.Tbl_FNames select types.FNames.ToList() ;
return comtypes.ToList();
}
catch (Exception err)
{
err.Message.ToString();
return null;
}
}
Santhosh Kumar JayaramanPosted Oct 12, 2012, 8:33 AM