J
Jeff
hi
asp.net 3.5
In my code I have this variable:
List<int> values = new List<int>();
I wonder how to trasfer this value to the database. That generic list
contain Id's I want to insert into a table, Each item in the generic list
represent a row in the database... so if generic list contains 3 items, then
3 rows will be created...
But I'm not sure how to transfer this generic list over to the database, so
far I've thought about these solutions:
- have a loop in my code which calls the stored procedure for each item in
the generic list,
- conver the generic list into a string, then pass the string.. but in the
stored procedure I would have to process the string again to get the Id
(with process the string I mean that the string contains for example
value like "2, 3, 4", I my stored procecdure code need to get the indivdual
id inside this string,)
any ideas
asp.net 3.5
In my code I have this variable:
List<int> values = new List<int>();
I wonder how to trasfer this value to the database. That generic list
contain Id's I want to insert into a table, Each item in the generic list
represent a row in the database... so if generic list contains 3 items, then
3 rows will be created...
But I'm not sure how to transfer this generic list over to the database, so
far I've thought about these solutions:
- have a loop in my code which calls the stored procedure for each item in
the generic list,
- conver the generic list into a string, then pass the string.. but in the
stored procedure I would have to process the string again to get the Id
(with process the string I mean that the string contains for example
value like "2, 3, 4", I my stored procecdure code need to get the indivdual
id inside this string,)
any ideas