iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am having a webgrid with SQL Datasource which allows BatchUpdate. I've written code behind using the samples given with the product.
Now, my issue is this: When a single row is updated, it affects the Physical DB and is reflected when refreshed, properly. But, when a set of rows are affected, in the code behind, the values are sent to the SQL Update Parameters correctly but the Physical DB is updated to have the last row change being applied to all those corresponding rows.
For eg., I am changing 2 rows' with column "ratio" = 76 and 85 respectively and update it. The code behind passes the value properly and the grid is showing the same. Once I press refresh, the DB shows BOTH those two rows to have "ratio" = 85.
My SQL update command is as usual normal: "Update table_name set ratio=@Ratio where ID=@Id";
SQL Update Parameters: @Ratio, @Id
SQL Update Parameter Values: ["Ratio"].DefaultValue = newValue;
["Id"].DefaultValue = newValue; in switch according to column name;
This all, I have given in OnBatchUpdate function and foreach PendingChanges; SQLDS.Update() is called for time. Is there anything wrong with this code? If it is taking the latest Default value, then the Key field should also be pointing to the latest row alone, meaning only one row is affected, right?
Sample:
Id Ratio Override
1 90 true
2 100 true
After Update, my Physical DB is like this:
1 100 true
foreach row
"Id".defaultvalue = keyValue;
foreach column_changed_data
tmp_ratio = newvalue if column = "Ratio"
tmp_override = newValue if column = "Override"
end loop;
if override = "true"
"Ratio".Defaultvalue = tmp_ratio
"Override".DefaultValue = tmp_override
else
SQL.update();
endloop;
I really appreciate the help. Thanks!
Hello,Thank you for the question.Based on your post, I try to modify one of WebGrid samples, “BindtoSqlDataSource.aspx” page.I enabled WebGrid’s Batch Update feature and Allow Edit feature in this page.And then I run the page in Internet Explorer 11, but unfortunately, it works fine on my end.I attached the modified page and video regarding the result on my end.Is it possible to you to modify the attached page, so that I can reproduce the issue on my end?Or could you provide me the simple working sample that replicates the issue? So that I can investigate the issue furthers more.Thank you for your help.Regards,Hans K.
Hi Hans,
Your sample works and I've applied it to mine successfully. The issue was that in SQLDatasource, I was giving values' variables (@Roles) as (@Rls) tmp_variable in the UpdateCommand.
Thanks alot for your Help.
Hello,I am glad to hear that. Should you have further question, please do not hesitate to contact us.Thank you.Regards,Hans K.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname