Tagged Questions
1
vote
1answer
27 views
Using Linq to select Place object with Tag.Name = “Restaurant” (many to many)
asp.net MVC 4 app - linq to objects with many to many relationship
Place object
public virtual int PlaceID { get; set; }
public virtual ICollection<Tag> Tags { get; set; }
public virtual ...
0
votes
1answer
33 views
make better LinQ queries mvc3
I had a question in my mind, to get the better performance of a linq query , is it better to use the select extension to select just the fields we need, not the whole fields?!!!
I have a table "News" ...
2
votes
2answers
31 views
How to use Html.DropDownListFor() helper in the right way
I have a signup form. I want users can select their pet's race using a select list in html. So i decided to use Html.DropDownListFor() Html helper.
In my model:
public class PetModel
{
public ...
0
votes
3answers
53 views
Convert string to long type and use in a linq query within asp.net MVC
Is it possible within Linq in C#, to convert a string field in a database, to a long type - and use it in the query?
Here, tme is a unix time (long) - but the field in the database, targetdate - is a ...
0
votes
2answers
44 views
I don't want to use @html.Action and @Rendersection can any one guide me what i use
I don't want to use @html.Action and @Rendersection can any one guide me what i use
i have a menu there is lot of companies coming in <li> it is fetching from DB
the menu should show on ...
4
votes
1answer
95 views
.net MVC passing linq data from controller to view
I am trying to pass data from controller to view. I have searched the web but could not find a solution.
if I do this it works:
Controller:
var yyy = (from a in Connection.Db.Authorities select a) ...
0
votes
1answer
29 views
Reading XML contents through LINQ to Dropdownlist
I am binding the XML contents to a Dropdownlist in MVC4. From the link, I tried reading the contents of the XML file. The Where clause in the code returns Object is not reffered to the instance of the ...
1
vote
1answer
73 views
How can I convert sql to linq
This is my SQL query
SELECT
sys.sysobjects.name Name,
sys.foreign_keys.*
FROM
sys.foreign_keys
inner join sys.sysobjects on
sys.foreign_keys.parent_object_id = sys.sysobjects.id
WHERE
...
1
vote
0answers
53 views
Show foreign key relation message when deleting records in mvc3
I have a table Country.CountryID is a foreign key on another table Energy.When I try to delete a record in Country table,I should get a message showing the foreign key relation.
That message should ...
1
vote
2answers
45 views
How to return a list of stores which are a specified distance from the entered Postcode
I am using Google Maps to create a store locator.
The user will enter their postcode and select from a dropdown menu the distnce from the location - 5, 10 15 20 miles.
Which will return the stores ...
0
votes
0answers
87 views
Returning NULL values while trying to use Left Join
In my database there is no null fields but when i start debbuging and add breakpoints i notice that the values is all null
This is my Code in Repository :
public IEnumerable<APPLICANT> ...
1
vote
0answers
67 views
ASP.NET MVC 3 C# How can i fetch the data where i can post all the details that doesnt contain profile_id
what can i add a statement where i can get also the one where Applicant context is not contain profile_id or when the profile_id is NULL so i can get all the data .
Heres my code :
var applicantList ...
0
votes
0answers
64 views
ASP.NET MVC3/Linq: Make multiple related rows' fields in a 1-to-many relationship appear on same row through joining and saving to an Excel file
I've tried various things but can't seem to find a solution. I've created the following Action to automatically save information I get from my database (not completely, just a test with 2 fields ...
2
votes
1answer
432 views
Get radiobutton selected according to value in database using mvc3
i have a radiobutton list in my create view.It is generated along with checkbox when selecting a dropdown.
@model IEnumerable<Admin.Models.viewmodel>
@foreach (var item in Model)
{
...
0
votes
1answer
36 views
“Does not contain definition for” error when using junction table created using .toTable() method in dbContext
I'm not sure what I'm doing wrong here. The table "class1class2" is not being recognised.(See code below). I want to be able to use the junction table
Context
public class context: DbContext
{
...