Trouble getting a UD110A table to update a column

I think I know what my issue is but don’t know how to fix it.

UD110Adapter uAdpt = new UD110Adapter(UD110Form);
               uAdpt.BOConnect();
               // Load the matching record in the UD110 table...
			   bool MorePages;
               SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
               opts.NamedSearch.WhereClauses.Add("UD110A", "Key1 = '" + JobNum + "' AND " + "Key2 = '" + PartNum + "' AND " + "Key3 = '" + AsmSeq + "' AND " + "ChildKey1 = '" + Serial + "'");
               opts.PageSize = 0;
               DataSet ds = uAdpt.GetRows(opts, out MorePages);
               ds.Tables["UD110A"].Rows[0]["Date08"] = ThisDate;
               uAdpt.Update(); 

The update at the bottom refers to the UD110Adapter but I don’t know how to make the changed ds.Tables[“UD110A”].Rows[0][“Date08”] record update as well.

Hey, check this thread out on formatting your code blocks. It will help people be able to read your code.

Sorry I was using the single quote not the thing under the tilda ~

1 Like

I think you’ll need to set the RowMod to “U”. But I’ve never done it that way…

So I added the RowMod with the Begin and End edit. Still not saving the updated “Date08” value to UD110A

               UD110Adapter uAdpt = new 
               UD110Adapter(UD110Form);
               uAdpt.BOConnect();

               // Load the matching record in the UD110 table...
			   bool MorePages;
               SearchOptions opts = new 
               SearchOptions(SearchMode.AutoSearch);
               opts.NamedSearch.WhereClauses.Add("UD110A", "Key1 = '" + JobNum + "' AND " + "Key2 = '" + PartNum + "' AND " + "Key3 = '" + AsmSeq + "' AND " + "ChildKey1 = '" + Serial + "'");
               opts.PageSize = 0;
               DataSet ds = uAdpt.GetRows(opts, out MorePages);
               ds.Tables["UD110A"].Rows[0].BeginEdit();
		ds.Tables["UD110A"].Rows[0]["RowMod"] = "U";
		ds.Tables["UD110A"].Rows[0]["Date08"] = ThisDate;
		ds.Tables["UD110A"].Rows[0].EndEdit();
               uAdpt.Update();
               uAdpt.Dispose();

Not sure what else to do here, suggestions?

So the other thing that some methods need is a before and after row. So before you make changes, copy the row, then make the the changes on one of the rows. So the row mod for one of them will be U and the other won’t have a row mod. This is the unchanged row. Use BufferCopy.Copy(rowfrom, rowtoo); to make the copy.

I ended up getting this to work

UD110Adapter uAdpt = new UD110Adapter(UD110Form);
				uAdpt.BOConnect();
				uAdpt.GetByID(JobNum, PartNum, AsmSeq, "", "");
				// Loop through UD110A to find the serial in ChildKey1 and update the date field in ColN
				foreach(DataRow dr in uAdpt.UD110Data.UD110A.Rows)
				{
					if(dr["ChildKey1"].ToString() == Serial)
					{
						dr.BeginEdit();
						dr[ColN] = ThisDate;
						dr.EndEdit();
					}
				}

ah, I was in server side code world in my head. We try to do as little as possible on the client side since all that code will be basically useless once you get to kinetic web UI. I’m glad you figured it out.

We will be royally screwed if we ever have to switch to Kinetic. Thousands of lines of code. I dread the thought.