textbox
hi iam new in visual basic 2010 h have adatagrid and i want to insert data in text box and i want to dispaly it in datagrid
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Mar 13, 2012, 11:17 AM
Public Class Form1
Private Sub btn_insert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_insert.Click
Dim dt As New DataTable()
dt.Columns.Add("Name", GetType(String))
Dim dr As DataRow = dt.NewRow()
dr("Name") = TextBox1.Text.ToString()
dt.Rows.Add(dr)
DataGridView1.DataSource = dt
End Sub
End Class
Thanks
If this post helps you mark it as answer
VulpesPosted Mar 11, 2012, 7:58 PM