By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

textbox to datagrid

P: n/a
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

Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.