Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update the datagrid value into database

Status
Not open for further replies.

Gkannan

Programmer
Nov 7, 2002
4
US
Hi all,

I have used server side data grid component in my webform. Using dataset in have retrieved some data from sql server and inserted into the datagrid. After I’m doing some changes in the value in particular column. Then I’m updating back the value into database using datagrid_updatecommand.

The problem is when I’m updating the database, I have find the particular row using the primary key values using findby method. When I’m trying to get the unique row .Net giving the error message.
The Error Message is “Object reference not set to an instance of an object.”

The code is
****************************************************
RTN = e.Item.Cells(1).Text
cycle = e.Item.Cells(2).Text
tb = CType(e.Item.Cells(3).Controls(0), TextBox)
Approved = Trim(tb.Text)
state = e.Item.Cells(4).Text

Dim row As DataSet4.Tbl_Tran_Package_EscalationRow
row = DataSet41.Tbl_Tran_Package_Escalation.FindByPkg_RTNPkg_Cycle_NoPkg_Stage(RTN, cycle, state)

r.Esc_Approved = Approved
SqlDataAdapter2.Update(DataSet41)
DataGrid1.EditItemIndex = -1
DataGrid1.DataBind()

*******************************************************
I’m getting in error in
row = DataSet41.Tbl_Tran_Package_Escalation.FindByPkg_RTNPkg_Cycle_NoPkg_Stage(RTN, cycle, state) this place only.


Please help me out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top