• Question

  • Hello All,
    I am a little new to LINQ, so please help me in a problem which i am facing here right now. I am developing a simple windows form application using LINQ. In that i am trying to update a few records to a table in SQL server, and i am also trying to insert rows to another table . I designed the app and everything worked fine.
    In the extreme happiness and joy of this , i decided to remove all the comments and paste a new clean code out of it, so i designed a similar app and pasted in all the code into that app with eveything as the same .
    The problem i have is that the old app works perfectly fine, but the new app does not update the database with any enteries. i am just trying to update a value in a row. The code is given below

     Dim db1 As New DataClasses1DataContext()

                                    db1.SubmitChanges()----------------------------- this thing works note that the table here is different though

                                     Dim pro1 = (From p In db1.tbl_SRVDBDetails_SignalGETs Where p.SVRDB = ser Select p)
                                  q = value already computed by the program.
                                    For Each p In pro1
                                        p.LoadCount = q

                                    db1.SubmitChanges()------------------------ this does not work

    THe same code works in the first app, and updates everything, but does not work in the second app. THere are no errors, and all the settings are same. i even tried in declaring a new datacontext db2, and then applying it , but nothing happened. I am very new to coding.
    Guys please help me in this situation as i feel extremely frustrated.
    Thanks in advance

    I am a fresh graduate and very much interested in Visual Basic/.Net programming
    Wednesday, February 18, 2009 1:13 AM

All replies

  • Hello All,
    Could this be a concurrency issue problem? I really need to fix this.. somebody please help........

    I am a fresh graduate and very much interested in Visual Basic/.Net programming
    Wednesday, February 18, 2009 8:52 AM
  • Hi,
    Not everything is the same, I'm sure, because it would work if it were :)
    If you expect to get help, you will have to give a better description of the problem. Did you check pro1.Count()? Is value of q what you expect it to be? What have you tried so far?
    Friday, February 20, 2009 3:53 AM