We help IT Professionals succeed at work.
Get Started

LINQ to SQL update not working!? :|

awilderbeast
awilderbeast asked
on
296 Views
Last Modified: 2013-12-16
Hi all,

ive tried every example i could find online to try and get this update working, nothing works, the data does not update but there are no errors! :|

can anyone help me out?
as you can see i currently tried the below two methods before posting

Thanks
protected void UpdateProfile(object sender, EventArgs e)
    {
        int ID = Convert.ToInt32(pID.Value);

        ClientDataContext dc = new ClientDataContext();

        ClientCV cvData = dc.ClientCVs.Single(p => p.ID == ID);
        /*
            var GetData = (from c in dc.ClientCVs
                          where c.ID == ID
                            select c).Single();
        
            GetData.Description = txtPersonalProfile.Text;
        */
        cvData.Description = txtPersonalProfile.Text;
        try
            {
                dc.SubmitChanges();
               lblHist.Text = "Personal profile updated!";
            }
            catch (Exception ex)
            {
                lblHist.Text = "Error: " + ex.ToString();
            }
        
        
        upProfile.Update();
    }

Open in new window

Comment
Watch Question
Retired
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
Unlock 1 Answer and 14 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE