Ashok Padmanabhan
Ashok Padmanabhan

Reputation: 2120

Creating a tag cloud using MVC 3, VBNET, and Entity Framework

I am creating a tag cloud and have read the various posts that describe creating tag clound in mvc including the one at mikesdotnetting, wijix.com, and codevoyeur. I also read the posts at SO on the matter. However i am having a block(mentally) as to how to handle the insert of the tags. I can insert the tags as a comma delimited string into my Posts table without issue. However I also need to insert each individual word into my Tags table. I need to sp[lit the tag string into individual words and then insert the individual words into my TagTable. I know how to handle the split but how can i handle the insert of separate tag words into the Tag table when i insert the post at the same time?

Upvotes: 1

Views: 605

Answers (1)

Steve Lydford
Steve Lydford

Reputation: 428

Once you have used the Split() method you will have an array of strings. Iterate over the array using as foreach loop inserting each word in a separate query.

Upvotes: 1

Related Questions