Hi Everyone,
I am creating a datagrid and I need the ability to add new rows to the database from this datagrid. I have placed textboxes in the footer of the datagrid and used an ItemCommand event handler so that when a linkbutton is clicked my function is called. Everything is going well except the text in the textboxes is not being passed properly to the function.
I am using the following command to extract the text.
sqlcmd.Parameters.Add("@GoodsDesc", SqlDbType.VarChar).Value = CType(e.Item.FindControl("txtGoodsDesc"), TextBox).Text
I'm sure this is right but I have a feeling the text is not being bound to the box or something as it is just giving me an empty string. Is there a step I am missing out here where I tell the code to set the text from the textboxes?