> Probably
MyCommand.Param eters("@Sport") .value = sport.text
That again gives me an Object reference not set to an instance of an
object error.
Here is the subroutine I'm using with the click event and such (this
is part of a datagrid display, as for the BindGrid() reference). I'm
able to view the page that displays the datagrid and textboxes/button,
but get the error when i try to add something to the 'sport' and
'articleheader' textboxes:
Sub AddArticle_Clic k(Sender As Object, E As EventArgs)
If (Page.IsValid)
Dim DS As DataSet
Dim MyCommand As SqlCommand
Dim InsertCmd As String = "insert into tblArticles
(sport,articleh eader) values (@Sport, @articleheader) "
MyCommand.Param eters.Add(New SqlParameter("@ Sport",
SqlDbType.VarCh ar, 50))
MyCommand.Param eters("@Sport") .value = sport.Text
MyCommand.Param eters.Add(New SqlParameter("@ articleheader",
SqlDbType.nVarC har, 255))
MyCommand.Param eters("@article header").value =
articleheader.T ext
MyCommand.Conne ction.Open()
' testing from aspalliance stuff
myCommand.Execu teNonQuery()
MyCommand.Conne ction.Close()
End If
BindGrid()
End Sub