textbox to datagrid

Z

zoneal

How can we pass information from some textboxes to the datagrid with
being connected to the database at first. i want the program to get
some data from the user first. when the user press enter then the data
from the textboxes will be passed to the corresponding datagrid. The
following are the sample code. The error says "Object reference not set
to an instance of an object. "

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim s As Object

Dim r As DataGridCommandEventArgs

Dim txtName As TextBox = r.Item.Cells(1).Controls(0)

txtName.Text = TextBox1.Text

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top