Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hello

I'm creating a tag database for my website in ASP.NET. In my system users can submit their articles and those articles can have tags associated with them. I searched the internet and found the toxi solution a good way to suit my needs. This schema has 3 tables:

Table_Articles: id, name, description
Table_TagMap: id, article_id, tag_id
Table_Tag: tag_id, name

I created the database and tables but I'm having troubles creating the insert command in asp.net. I think I have to use the following process to add the tags?

1. sort submitted tags into array
2. for every tag in the array:
1. get tag_id from tags where name matches the current tag
2. if that returns 0 rows:
1. add tag to tags table
2. get the tag_id
3. add article_id and tag_id to tagmap
3. finish (give user the a-okay, etc)

could you help me write the insert query in asp.net?

Thanks in advance!
Posted
Updated 15-Dec-13 18:37pm
v5
Comments
JoCodes 16-Dec-13 0:36am    
There are already numerous articles available in the internet . Here its expected to ask questions after an attempt has been done from the OP's end . Then if stuck somewhere ask those specific questions.

1 solution

No body is going to write the whole code for you. You have to do that.
If you face difficulty in code, then we can help. But that is you who is going to code.

You have all the steps and logic with you. It is just a matter of interpreting in SQL language.
You need to use statements of SQL and IF ELSE block etc.. So, go on write to achieve your goal.

If you don't know SQL, then first learn by searching some basic articles on Google or on Code Project itself.
You will find many examples. Just go through them and learn.

Hope you understand.

Keep coding. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900