Want a query possibly a single query for the below conditions
I need a query, expert please help with this... Thanks
User picks row 1, this means your C# can know "Lot21009BB1C3" (putting text instead of image would have let me copy it, btw) but you write like the c# app doesn't know any other row..
Which means you can run a query:
UPDATE t SET HtrOnBy = @HtrOnBy, ChtrOnRemark = @ChtrOnRemark
WHERE R2IGTNo LIKE @R2IGTNo
And your c# shall put the following values:
@HtrOnBy = "Whatever it knows the first row HtrOnBy is"
@ChtrOnRemark = "Whatever it knows the first row ChtrOnRemark is"
@R2IGTNo = firstRowR2IGTNo.Remove(9) + "%"
We take the first 9 characters of R2IGTNo and add a percent. SQL will update all the rows that start with those, doesn't matter if it's 3 or 4 etc
If the number of chars varies, then you will have to get more smart about how you do your substring, such as looking for the first character after the numbers (eg regex)