Results 1 to 2 of 2

Thread: Datagrid Delete Row (Sad Newbie Q)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2004
    Posts
    308

    Datagrid Delete Row (Sad Newbie Q)

    Please, please please...

    Can somebody tell me simply how to do the Delete Query that allows me to delete just one row based upon a column in the datagrid ? how do I map the parameter in the query to a rown in the datagrid ?

    I know I should know but its drivin' me insane !

    Thanks

    Chubby.

  2. #2
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    790

    Re: Datagrid Delete Row (Sad Newbie Q)

    It should look something like this :



    Code:
     Dim no As Integer                    
    no = DataGrid1.Item(x, 1)                   
     Dim s As String                    
    con = New SqlConnection("server=200.100.100.100;user id=sa;pwd=hello;database=demo;")  
    con.Open()      
      s = "delete  products where productid=" & no & ""      
           cmd = New SqlCommand(s, con)                    
    cmd.ExecuteNonQuery()                
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width