Search Results

Search found 39 results on 2 pages for 'ognjenb'.

Page 2/2 | < Previous Page | 1 2 

  • ado.net data entity problem

    - by ognjenb
    I have this error Cannot implicitly convert type 'System.Linq.IQueryable' to 'Mvc.Models.engineer'. An explicit conversion exists (are you missing a cast?) after write this code engineer Ing = new engineer(); Ing = from j in testPersons.ibekoengineer select j.Name; What is wrong?

    Read the article

  • update database problem with asp.net mvc 2

    - by ognjenb
    [AcceptVerbs(HttpVerbs.Post)] public ActionResult Numbers(int id, int val, int name) { int temp = val % 2; brojevi br = new brojevi(); if (temp == 1 && name == 1) { var nmb = (from n in numbers.brojevi where n.prvi_br == id select n).First(); br.prvi_br = nmb.prvi_br - 1; numbers.SaveChanges(); } var nm = from n in numbers.brojevi select n; return View(nm); } Data table brojevi have 3 fields but I have to change(update) only one of them (prvi_br). Why my solutions doesn't save changes to database

    Read the article

  • anonymous type and multiple properties

    - by ognjenb
    I have this error: An anonymous type cannot have multiple properties with the same name. Whether this can be resolved with alias ie, whether an alias exists in LINQ var device_query = from d in DevicesEntities.device join dt in DevicesEntities.devicetype on d.DeviceTypeId equals dt.Id join l in DevicesEntities.location on d.Id equals l.DeviceId join loc in DevicesEntities.locationname on l.LocationNameId equals loc.Id where l.DeviceId == d.Id select new { d.Id, d.DeviceTypeId, d.SerialNumber, d.FirmwareRev, d.ProductionDate, d.ReparationDate, d.DateOfLastCalibration, d.DateOfLastCalibrationCheck, d.CalCertificateFile, d.Notes, d.TestReportFile, d.WarrantyFile, d.CertificateOfOriginFile, d.QCPermissionFile, d.Reserved, d.ReservedFor, d.Weight, d.Price, d.SoftwareVersion, dt.Name, dt.ArticleNumber, dt.Type, l.StartDate, //AS LastStartDate, l.LocationNameId, loc.Name //in this line I have problem };

    Read the article

  • specified size of td

    - by ognjenb
    <table class="data-table"> <tr> <th style="width: 200px;"> Description </th> </tr> <% foreach (var item in Model) { %> <tr> <td style="width: 200px;"> <%= Html.Encode(item.Description) %> </td> </tr> </table> browser html: <table class="data-table"> <tr> <th style="width: 200px;"> Description </th> </tr> <tr> <td > This is description </td> </tr> </table> Why this td size is not to apply on View page? In Design view on VS 2008 td size is applied, but after run project in my browser not have specified size

    Read the article

  • trigger problem in mySql database

    - by ognjenb
    I have this code (mySql 5.1.36) CREATE TRIGGER problem_description AFTER INSERT ON problem_description FOR EACH ROW BEGIN INSERT INTO log SET Id=NEW.Id,user_name=NEW.user_name; END; and have this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

    Read the article

  • sql to linq translated code

    - by ognjenb
    SQL: SELECT o.Id, o.OrderNumber, o.Date, d.Name AS 'Distributor', d.Notes AS 'DistrNotes', -- distributer c.Name AS 'Custoer', c.Notes AS 'CustmNotes', -- customer t.Name AS 'Transporter', -- transporter o.InvoiceFile, o.Notes, o.AwbFile, o.TrackingFile, o.Status, o.DeliveryNotification, o.ServiceType, o.ValidityDate, o.DeliveryTime, o.Weight, o.CustomerId, o.CustomerOrderNumber, o.CustomerDate, o.Shipment, o.Payment, o.TransporterId, o.TotalPrice, o.Discount, o.AlreadyPaid, o.Delivered, o.Received, o.OrderEnteredBy, CONCAT(e.Name, ' ', e.Surname) AS 'IBEKO Engineer', o.Confirmed FROM `order` o LEFT JOIN person d ON o.`DistributorId` = d.`Id` LEFT JOIN person c ON o.`CustomerId` = c.Id LEFT JOIN Transporter t ON o.`TransporterId` = t.Id LEFT JOIN IbekoEngineer e ON o.OrderEnteredBy = e.Id LINQ: testEntities6 ordersEntities = new testEntities6(); var orders_query = (from o in ordersEntities.order join pd in ordersEntities.person on o.DistributorId equals pd.Id join pc in ordersEntities.person on o.CustomerId equals pc.Id join t in ordersEntities.transporter on o.TransporterId equals t.Id select new OrdersModel { Id = o.Id, OrderNumber = o.OrderNumber, Date = o.Date, Distributor_Name = pdk.Name, Distributor_Notes = pdk.Notes, Customer_Name = pc.Name, Customer_Notes = pc.Notes, Transporter_Name = t.Name, InvoiceFile = o.InvoiceFile, Notes = o.Notes, AwbFile = o.AwbFile, TrackingFile = o.TrackingFile, Status = o.Status, DeliveryNotification = o.DeliveryNotification, ServiceType = o.ServiceType, ValidityDate = o.ValidityDate, DeliveryTime = o.DeliveryTime, Weight = o.Weight, CustomerId = o.CustomerId, CustomerOrderNumber = o.CustomerOrderNumber, CustomerDate = o.CustomerDate, Shipment = o.Shipment, Payment = o.Payment, TransporterId = o.TransporterId, TotalPrice = o.TotalPrice, Discount = o.Discount, AlreadyPaid = o.AlreadyPaid, Delivered = o.Delivered, Received = o.Received, OrderEnteredBy = o.OrderEnteredBy, Confirmed = o.Confirmed }); I translated the above SQL code into linq. SQL code return data from database but LINQ not return data. Why?

    Read the article

  • filtering problem in LINQ

    - by ognjenb
    var query = from d in testPersons.person where d.Name == txtbox select d; txtbox is text box on View page. How change this code to return all names who starts with any part of name? For example:when I type R in text box, on View page, this query should return all names who is start with character R

    Read the article

  • SQL to LINQ translating probem

    - by ognjenb
    I have problem with convertion this SQL statement to LINQ : SELECT a.Id, a.Name, a.ArtiklNumber, a.Notes, a.Weight, l.StartDate AS LastStartDate, l.LocationNameId, loc.Name AS CarrentLocation, a.Reserved FROM Accessories a LEFT OUTER JOIN Location l LEFT JOIN LocationName loc ON l.LocationNameId = loc.Id ON a.Id = (SELECT AccessoriesId FROM Location WHERE AccessoriesId = a.Id HAVING MAX(StartDate) = StartDate ) This is part of my translated code: testEntities6 accessoriesEntities = new testEntities6(); var max_StartDate = (from msd in accessoriesEntities.location from d in accessoriesEntities.device where msd.DeviceId == d.Id select msd.StartDate).Min(); var accessories_query = from accs in accessoriesEntities.accessories join l in accessoriesEntities.location on accs.Id equals l.AccessoriesId join loc in accessoriesEntities.locationname on l.LocationNameId equals loc.Id select new AccessoriesModel { //Accessories Id = accs.Id, Name = accs.Name, ArtiklNumber = accs.ArtiklNumber, Notes = accs.Notes, Weight = accs.Weight, Reserved = accs.Reserved, //Location LocationNameId = l.LocationNameId, StartDate = max_StartDate,//l.StartDate, //Locationname Loc_name = loc.Name };

    Read the article

  • left join on linq

    - by ognjenb
    SQL: FROM `order` o LEFT JOIN person d ON o.`DistributorId` = d.`Id` LEFT JOIN person c ON o.`CustomerId` = c.Id LEFT JOIN Transporter t ON o.`TransporterId` = t.Id LEFT JOIN IbekoEngineer e ON o.OrderEnteredBy = e.Id In any way to translate this 4 left join to LINQ query

    Read the article

  • How modify Details view

    - by ognjenb
    How modify strongly typed Details view created in asp.net mvc? View need to present data Similarly to the table. Is this possible in CSS? Part of my view is: <fieldset > <legend>Fields</legend> <p> ArticleNumber: <%= Html.Encode(Model.ArticleNumber) %> </p> <p> CalCertificateFile: <%= Html.Encode(Model.CalCertificateFile) %> </p> </fieldset>

    Read the article

< Previous Page | 1 2