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
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 11, 2012, 3:58 PM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 13, 2012, 7:17 AM EDT
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