Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
    Dim i As Integer
    Dim a, b, c As New Object
    a = Me.DataGridView1(0, i).Value.ToString
    b = Me.DataGridView1(1, i).Value.ToString
    c = Me.DataGridView1(2, i).Value.ToString
    i = DataGridView1.CurrentRow.Index
    With _SPP
        .m_oMAP.Text = a.ToString & "." & b.ToString
        .m_oDescription.Text = c.ToString
    End With
End Sub




I want send value in datagridview into textbox different form but I don't know ... can you help me for give me a solution ??? true or false this source
Posted

Create a string property in your second form, that will hold the textbox contents. Then in your Main form you need to hold a reference to the second form. Then when your DataGridView cell changes you can update the string property you created, and bind the textbox to that string:

something like this

VB
Public Class Form1
    Private myForm2 As Form2
    Private Sub DataGridView1_CellLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellLeave
        myForm2.textBoxResult = DataGridView1.CurrentCell.Value
    End Sub
End Class


VB
Public Class Form2
    Public textBoxResult As String
End Class


Hope this helps
 
Share this answer
 
string stSQL = "SELECT * FROM [Tablename];

			conn = <sqlconnection>
			SqlCommand cmd = new SqlCommand(stSQL, conn);
			SqlDataReader myReader;
			myReader = cmd.ExecuteReader();
			myReader.Read();

                       textboxid.text=myReadaer["Column Name"].ToString();

            </sqlconnection>



I think surely it is helpful to you

Happy Codding....:)

Seshu
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900