DataGrid migration (more detail)

J

Johnpc

I need to copy the vb code for a datagrid out of one solution into another.

so I copyied the .aspx and aspx.vb files, but when I build I get the
following error

Type 'TextBox' is not defined.

from the following

Private Sub salesLinksGrid_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
salesLinksGrid.UpdateCommand

'retrieve textbox control from saleslinksgrid
Dim txtFactor = CType(e.Item.Cells(2).Controls(0), TextBox)
'retrieve values to produce the primary key..
....
....

It's as if something is not registered in the project i've copied the code
too, but I just dont know.....

when I run the project anyway with the build error I get the following

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an
object.]
stockcontrolx.SalesLinks.bindGrid() in
C:\scx\SalesLinksASPX\SalesLinks.aspx.vb:46


which is a line of code which sets the SQL command text

Can anyone advise

Thanks
 

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,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top