textbox to datagrid

S

sympatico

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

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,089
Latest member
Ketologenic

Latest Threads

Top