Results 1 to 3 of 3

Thread: how do i send data from datagrid to textbox

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    38

    how do i send data from datagrid to textbox

    i have a datagrid and i am not sure which event to use or how to use it. I want a situation whereby a user clicks or selects an item and it shows in a textbox then i have a button that will delete that item from the database

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: how do i send data from datagrid to textbox

    you mean a datagridview + not a datagrid right?
    they're 2 different controls.

    anyway, how is your dgv bound to a datasource?
    do you already have the code for deleting the row?

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    38

    Re: how do i send data from datagrid to textbox

    Its a datagrid view and this is how i am populating and binding the grid to datasource from the dbase
    Dim da As SqlDataAdapter
    ds = New DataSet
    Dim cmd As New SqlCommand
    cmd.CommandType = CommandType.Text
    cmd.Connection = General.dbConnection
    'Get Stock Items
    cmd.CommandText = "Select * From _Zones"
    da = New SqlDataAdapter(cmd)
    da.Fill(ds, "Zones")
    dgZones.DataSource = ds.Tables("Zones")

    and i do not have the code to delete the selected item

Tags for this Thread

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