Hello,

I searched google and the forums to try find a good tutorial or example but was not able to!

I have a form called ViewUsersGrid.vb and there is a datagridview1 in there. This uses the SQL cmd to fill the datagrid select firstname,lastname from users etc.

This then fills the grid with the information, now I want to use the datagrid doubleclick event, to double click a row to show viewuser.vb which I can do, but I want it then to fill the empty text fields with the information for that user I have double clicked on.

Thanks.

Datagridview.vb code

Code:
Dim connection As New SqlClient.SqlConnection
        Dim command As New SqlClient.SqlCommand
        Dim adaptor As New SqlClient.SqlDataAdapter
        Dim AID As String = AgentIDNum.AgentIDNumber

        Dim dataset As New DataSet

        connection.ConnectionString = "Data Source=ANDY-PC\LETTINGS;Initial Catalog=easylet_database;User Id=sa;Password=g3m1n1;"
        command.CommandText = "Select Title, FirstName, LastName, Telephone, Telephone2, Email from Users"
        connection.Open()

        command.Connection = connection

        adaptor.SelectCommand = command

        adaptor.Fill(dataset, "MyTable")
        DataGridView1.DataSource = dataset.Tables("MyTable").DefaultView
I also have a save button in the viewusers form, so once its loaded into the new form I want to say change the password and click save and its save it.

cheers.