What you need to do is be able to determine what row the user has clicked on and then open your new form that will show the details.
Here are some samples of how to determine what row the user clicked on: http://msdn.microsoft.com/en-us/library/b8yw7fbd.aspx http://www.thescarms.com/dotnet/HitTest.aspx http://bytes.com/groups/net-c/228054-datagrid-mousedown-event Here's some information on opening another form and passing information between forms http://www.developerfusion.com/samplechapter/4375/building-windows-applications/9/ Note: All this information was found through a simple Google search. On May 27, 10:19 am, digger_54 <[email protected]> wrote: > first off, I am a noob. so fogive me if this is really easy. > > I have a form with a datagrid, what I want to be able to do is have > the user click on a row in the table and it opens up a new form that > shows all the info of that row. > > The code that I have to create the connection to the DB is as follows > and when running the program, that data appears. > > =============================== > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > 'TODO: This line of code loads data into the > 'Carpool.CAR_POOL' table. You can move, or remove it, as needed. > Me.CAR_POOLTableAdapter.Fill(Me.Carpool.CAR_POOL) > Dim SQL_GET_CAR_POOL_INFO As String = "SELECT * FROM > TRAFFIC.CAR_POOL" > Dim ds_car_pool As New carpool > Dim dr_car_pool As DataRow = Nothing > Dim rdr As OracleDataReader = Nothing > > rdr = OraHelper.ExecuteReader(testkcl_conn_string, > CommandType.Text, SQL_GET_CAR_POOL_INFO, Nothing) > While (rdr.Read()) > Dim drow As carpool.CAR_POOLRow > drow = ds_car_pool.CAR_POOL.NewRow > If Not rdr.IsDBNull(0) Then > drow.CAR_SEQ_NUM = rdr.GetInt32(0) > End If > If Not rdr.IsDBNull(1) Then > drow.CAR_NUMBER = rdr.GetString(1) > End If > If Not rdr.IsDBNull(1) Then > drow.ACTIVE = rdr.GetString(2) > End If > If Not rdr.IsDBNull(1) Then > drow.IN_SERVICE_DATE = rdr.GetDateTime(3) > End If > If Not rdr.IsDBNull(1) Then > drow.OUT_SERVICE_DATE = rdr.GetDateTime(4) > End If > If Not rdr.IsDBNull(1) Then > drow.POOL_SEQ_NUM = rdr.GetString(5) > End If > If Not rdr.IsDBNull(1) Then > drow.OWNERSHIP_CODE = rdr.GetString(6) > End If > If Not rdr.IsDBNull(1) Then > drow.CREATION = rdr.GetDateTime(7) > End If > If Not rdr.IsDBNull(1) Then > drow.VERSION = rdr.GetDateTime(8) > End If > If Not rdr.IsDBNull(1) Then > drow.DO_NOT_LOAD = rdr.GetString(9) > End If > ds_car_pool.CAR_POOL.Rows.Add(drow) > End While > ds_car_pool.AcceptChanges() > End Sub > =================================
