Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top