Click here to Skip to main content
11,491,459 members (73,030 online)
Rate this: bad
good
Please Sign up or sign in to vote.
I have this project to do working with database in viusal basic, but the problem is i have the code its correct i mean it doesn't come out as error but it doesnt function when running the program

Here is the problem:
this is my code for the update button( to update the data in the datagrid)

Private Sub btnUpdateComp_Click(sender As Object, e As EventArgs) Handles btnUpdateComp.Click
    Dim strTheComputerSelected = DataGridView1.SelectedCells.ToString
 
    Dim theComputer = (From aComputer In DB.Computers
                     Where aComputer.SerialNumber = DataGridView1.Focused.ToString
                     Select aComputer).FirstOrDefault
 

 
    theComputer.SerialNumber = txtSerialNum.Text
    theComputer.Color = cboColor.Text
    theComputer.ManCompany = cboMCompany.Text
    theComputer.OpertionSys = cboOS.Text
    theComputer.Price = txtPrice.Text
    theComputer.RAM = txtRAM.Text
    theComputer.ScreenSize = txtScreen.Text
    theComputer.Type = cboType.Text
    theComputer.Weight = txtWeight.Text
    DB.SaveChanges()
    UpdateComputersList()
End Sub

but it does not work!!

Any Comments?
Posted 28-Apr-13 20:07pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 521
1 Maciej Los 336
2 Andy Lanng 273
3 Sascha Lefèvre 245
4 OriginalGriff 155
0 Sergey Alexandrovich Kryukov 9,829
1 OriginalGriff 8,530
2 Sascha Lefèvre 3,579
3 Maciej Los 3,332
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 29 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100