Click here to Skip to main content
       

.NET Framework

 
AnswerRe: Private byte is being increased continuously without any request Pinmemberjschell24-Dec-12 7:57 
QuestionMSI not taking/Installing .NET framework Pinmembersjs4u19-Dec-12 17:25 
AnswerRe: MSI not taking/Installing .NET framework PinmvpDave Kreskowiak19-Dec-12 18:55 
QuestionEntity Framework is Updating other column also Pinmemberindian14319-Dec-12 15:51 
Hi All,
 
I am using EF 1.0 trying to update a column called doc id which is nullable column, but the EF is updating the other column also along with this column. There is no other place that I am updating that column mistakenly.
 
Is there any way that I can avoid this kind of situation happening. Because it is happening only in Integration Env, but not in Dev. I dont know what to do now. Please help me.
 
Below is my code which is updating doc id field:
 
 
            Using _databasefactory As New DatabaseFactory()
                Dim context = _databasefactory.DatabaseContext
 
                If Not String.IsNullOrEmpty(temp_doc_id) And Not String.IsNullOrEmpty(doc_id) Then
                    Dim reqs = (From r In context.requests Where r.claim.claim_no.Equals(claim_no) And r.temp_doc_id.Equals(temp_doc_id)) 'r.empl_accnt_no.Equals(emplacctnumber) and _

                    Dim i = reqs.Count()
                    If Constants.EnableLogger And logr IsNot Nothing And Constants.DirectoryExists(Constants.GetLoggerDirectory()) Then
                        logr.log(1, "Begin RequestEntity : UpdateOrInsertRequestDocId, claim_no, temp_doc_id, i: " + claim_no + ", " + temp_doc_id + ", " + i.ToString())
                    End If
 
                    If Constants.EnableLogger And logr IsNot Nothing And Constants.DirectoryExists(Constants.GetLoggerDirectory()) Then
                        logr.log(1, "Inserting RequestEntity : UpdateOrInsertRequestDocId emplacctnumber, ManualClaimNo, doc_id, temp_doc_id, request_status, requestreceivedhow: " + _
                                 emplacctnumber + ", " + ManualClaimNo.ToString + ", " + doc_id + ", " + temp_doc_id + ", " + request_status + ", " + requestreceivedhow)
                    End If
 
                    Dim res = 0
                    If reqs Is Nothing Then
                        Dim rq = New request()
                        rq.claim = (From r In context.claims Where r.claim_no.Equals(claim_no)).FirstOrDefault()
                        rq.empl_accnt_no = emplacctnumber
                        rq.manual_claim_no = ManualClaimNo
                        rq.doc_id = doc_id
                        rq.temp_doc_id = temp_doc_id
                        rq.request_status = request_status '"OANEW"
                        rq.request_received_how = requestreceivedhow
                        rq.last_update_ts = DateTime.Now
                        rq.created_ts = DateTime.Now
                        rq.created_by = created_by
                        rq.last_updated_by = lastupdated_by
                        rq.comments = String.Empty
                        context.AddTorequests(rq)
 
                        If Constants.EnableLogger And logr IsNot Nothing And Constants.DirectoryExists(Constants.GetLoggerDirectory()) Then
                            logr.log(1, "Inserting RequestEntity : UpdateOrInsertRequestDocId emplacctnumber, ManualClaimNo, doc_id, temp_doc_id, request_status, requestreceivedhow: " + _
                                     emplacctnumber + ", " + ManualClaimNo.ToString + ", " + doc_id + ", " + temp_doc_id + ", " + request_status + ", " + requestreceivedhow)
                        End If
 
                        Return context.SaveChanges()
                    ElseIf reqs.Count() <= 0 Then
                        Dim rq = New request()
                        rq.claim = (From r In context.claims Where r.claim_no.Equals(claim_no)).FirstOrDefault()
                        rq.empl_accnt_no = emplacctnumber
                        rq.manual_claim_no = ManualClaimNo
                        rq.doc_id = doc_id
                        rq.temp_doc_id = temp_doc_id
                        rq.request_status = request_status '"OANEW"
                        rq.request_received_how = requestreceivedhow
                        rq.last_update_ts = DateTime.Now
                        rq.created_ts = DateTime.Now
                        rq.created_by = created_by
                        rq.last_updated_by = lastupdated_by
                        rq.comments = String.Empty
 
                        If Constants.EnableLogger And logr IsNot Nothing And Constants.DirectoryExists(Constants.GetLoggerDirectory()) Then
                            logr.log(1, "Inserting RequestEntity : UpdateOrInsertRequestDocId, emplacctnumber, ManualClaimNo, doc_id, temp_doc_id, request_status, requestreceivedhow: " + _
                                     emplacctnumber + ", " + ManualClaimNo.ToString + ", " + doc_id + ", " + temp_doc_id + ", " + request_status + ", " + requestreceivedhow)
                        End If
 
                        context.AddTorequests(rq)
                        Return context.SaveChanges()
                    Else
                        Dim rq = reqs.FirstOrDefault()
                        rq.doc_id = doc_id
                        res = context.SaveChanges()
                        Return res
                    End If
                End If
            End Using
Thanks & Regards,
 
Abdul Aleem Mohammad
St Louis MO - USA

QuestionUnable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 [modified] Pinmembersr15918-Dec-12 23:26 
SuggestionRe: Unable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 PinmvpRichard MacCutchan18-Dec-12 23:52 
QuestionCustomer Hacking System Time PinmemberKlockness18-Dec-12 4:33 
AnswerRe: Customer Hacking System Time PinmvpRichard MacCutchan18-Dec-12 6:46 
GeneralRe: Customer Hacking System Time PinmemberKlockness18-Dec-12 10:25 
AnswerRe: Customer Hacking System Time PinmemberRichard Deeming18-Dec-12 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 20 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid