Let’s consider I have two comma separated strings as written below.
string name = "A,B,C,D";
string value = "100,200,300,400";
So I want to split these two strings and want to insert into DataTable which is as shown below.
Name Value
A 100
B 200
C 300
D 400
Try something like this:
But you should implement some validation code to make it more
appropriate.