Reputation: 11
How can I retrieve data from a gridview to text box in VB.NET? I want to select the first row of values (suppose that it contains:rollno and name) and to display it in textbox1 and textbox2. That is, I want to display the values of selected rows.
Upvotes: 1
Views: 1030
Reputation: 166576
You can try something like this
Dim d As DataTable
d = DataGridView1.DataSource
TextBox1.Text = d.Rows(0)("rollno")
Upvotes: 1