Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. how do i remove selected row permanently from sql database through datagrid?

how do i remove selected row permanently from sql database through datagrid?

Scheduled Pinned Locked Moved Windows Forms
databasetutorialquestioncsharp
3 Posts 3 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sathyan_8294
    wrote on last edited by
    #1

    i am using vb.net 2003.i am doing my project in vb.net windows application. how do i remove selected row permanently from sql database through datagrid in vb.net windows form during runtime. for example, values are in datagrid like name age rollno city ramu 22 68 chennai rajesh 23 70 cbe kamal 21 52 salem arun 25 04 trichy here name,age,rollno,city are field name.now i want to remove selected row permanently from sql database through datagrid.In this datagrid,if i select "kamal" row(kamal,21,52,salem) means,that kamal row will remove permanently from sql database.how to do these.i want in vb.net windows application,not web application.plz help me.

    M L 2 Replies Last reply
    0
    • S sathyan_8294

      i am using vb.net 2003.i am doing my project in vb.net windows application. how do i remove selected row permanently from sql database through datagrid in vb.net windows form during runtime. for example, values are in datagrid like name age rollno city ramu 22 68 chennai rajesh 23 70 cbe kamal 21 52 salem arun 25 04 trichy here name,age,rollno,city are field name.now i want to remove selected row permanently from sql database through datagrid.In this datagrid,if i select "kamal" row(kamal,21,52,salem) means,that kamal row will remove permanently from sql database.how to do these.i want in vb.net windows application,not web application.plz help me.

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      :omg: As far as I understood from problem, the simple answer is to fire a delete query on the database with where condition. Befroe that you can get the row items by trapping the cell clicked event. it will give you the row number and from its items list you can build the quesry. Hope this helps

      1 Reply Last reply
      0
      • S sathyan_8294

        i am using vb.net 2003.i am doing my project in vb.net windows application. how do i remove selected row permanently from sql database through datagrid in vb.net windows form during runtime. for example, values are in datagrid like name age rollno city ramu 22 68 chennai rajesh 23 70 cbe kamal 21 52 salem arun 25 04 trichy here name,age,rollno,city are field name.now i want to remove selected row permanently from sql database through datagrid.In this datagrid,if i select "kamal" row(kamal,21,52,salem) means,that kamal row will remove permanently from sql database.how to do these.i want in vb.net windows application,not web application.plz help me.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hi my be I can imagine you database Schema !! assume that you have a table like this Table Name = Table1 Table Fields Name | Age | Home ---------------------------- stark | 25 | MyHome sonya | 21 | HerHome if you want to delete "stark , 25 , MyHome" then you have to write an Sql Query like this Delete from Table1 Where Name = 'Stark' and Age = '25' And Home = 'MyHome' P.S the best Schema for your table should be , like this ID | Name | Age | Home ---------------------------- 1 | stark | 25 | MyHome 2 | sonya | 21 | HerHome then your query will be like this Delete from Table1 Where ID = '1' hope this will help .... if my answer was going far from you Question .. Just let me know , I still have more ideas to help you Have Good day

        I know nothing , I know nothing

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups