Let the DB do the work, have a table represent a users apps. Then you could simply count, add, delete...
Adding values to rows, retrieving them and splitting them
题
I have a MySQL database with column 'apps_owned'. Everytime a user buys an app, I want their row to have the AppID added to it. For example,
apps_owned = 1, 4, 75 etc.
How would I do this?
Next, I need to split these up into individual numbers in C#. I don't know how I would remove the comma's to get a whole number. Is there any way of doing this. I know how to get the numbers from the database, I just don't know how to add to them or split them. Is there any easier way to do this?
没有正确的解决方案
其他提示
To Split you can do something like:
var result = apps_owned.Split(' ').Select(x => int.Parse(x.ToString.Replace(",", ""))).ToArray<int>();
不隶属于 StackOverflow