Select multiple fields group by and sum
I want to do a query with linq (list of objects) and I really don’t know how to do it, I can do the group and the sum but can’t select rest of the fields.
Example:
I want to do a query with linq (list of objects) and I really don’t know how to do it, I can do the group and the sum but can’t select rest of the fields.
Example:
I need to set my connection string for Linq to Sql based on an environment variable. I have a function which will return the connection string from the web.config based on the environment variable, but how do I get Linq to always use this “dynamically created” connection string (preferably without having to specify it every time)?
I am using the Entity Framework for the first time and want to know if the following is possible – I have generated my classes from the DB, and have one called Category.
I’m learning Linq to SQL and I’m having trouble grasping it. I’m trying to simply return a single (boolean) value in C# with a Linq query.
I have already developed an application which returns DataTable everywhere.
Have a requirement to create instance of Entity Framework generated Model class dynamically by passing table name as parameter (Model generated in DB first approach and using EF 6.0)
I have problems binding both a telerik RadGrid and a plain vanilla ASP.NET GridView to the results of the following LINQ to entities query. In both cases the grids contain the correct number of rows, but the data from only the first handful of rows is duplicated in all the other rows. I’m directly assigning the return value from this code the the DataSource property on the grids.
Is there an easy way to convert a Datatable to a multidimensional string array?
I have this code:
The last two lines of this code do not work correctly — the results are coming back from the LINQ query. I’m just not sure how to successfully bind the indicated columns in the results to the textfield and valuefield of the dropdownlist: