shms 0 Report post Posted January 28, 2007 ni aku ade wat save function ..tp ada error gini yang kuar ... ada tak sesapa yg tau 1010 - STUFFPT Update requires the InsertCommand to have a connection object. The Connection property of the InsertCommand has not been initialized.ni code nye ..public bool SaveEditCodeTemplate(CodeDescription.TugBoatCls cTug) { bool bOK = false; try { DataRow dr = null; OpenCodeTable(cTug); if (dsUser.Tables["STUFFPT"].Rows.Count > 0) dr = dsUser.Tables["STUFFPT"].Rows[0]; else dr = dsUser.Tables["STUFFPT"].NewRow(); dr["BRANCHID"] = cTug.branchid.ToString();//ADDED 280107 dr["CODE"] = cTug.txtVClass_Code.ToString(); dr["DESC1"] = cTug.txtVClass_Desc.ToString(); dr["PORT"] = cTug.txtPort.ToString(); dr["STATION"] = cTug.wcbCustom.ToString(); if (dsUser.Tables["STUFFPT"].Rows.Count == 0) dsUser.Tables["STUFFPT"].Rows.Add(dr); SetTugTemplateAdapter(); if (!UpdateDBTable("STUFFPT", ref ad, ref dsUser)) _errmsg = this.GetErrorMsg; else bOK = true; } catch (Exception ex) { _errmsg = "SaveEditCountryTemplate->" + ex.Message; } return bOK; } Quote Share this post Link to post Share on other sites