r p

r p

  • NA
  • 343
  • 0

Inserting into Table

Oct 9 2008 7:20 AM
I have a table called JobProfile which has ProfileID, AddedDate, Username, IndustryID, LocationID, Skills.
Now data to this table will be coming from 3 different forms:-

1. Industry.aspx contains Industry name in a dropdownlist and id as value for the dropdownlist. When the user clicks submit,
industryid will be inserted to the database by using an insert/update statement.
2. Location.aspx contains a dropdown list which contains id as its value and when the user presses submit the id is inserted
using an INSERT/UPDATE STATEMENT.
3. Skill is a free text when the user submits again I am calling an INSERT/UPDATE STATEMENT.
In my master page, I have menu called Industry, Location and Skill. The user can choose any and start filling the respective form.
ProfileID is an int which will increment automatically.
I have stored procedures called InsertIndustry, InsertLocation and InsertSkill. In each of the stored procedure,
before calling insert/update statement, I will check whether a record with the SAME USER NAME is existing or not. If existing I will call an update statement
else an insert statement.
For EXAMPLE  if the user visits Industry.aspx first and inserts the record, then for Location.aspx and Skill.aspx I will be calling only UPDATE statement.
Am I doing the CORRECT WAY?
 


Answers (1)