Hi guys I got a table called rc_Pages then I got a column called pName (Pages Name) and now I have made a new column called pCategory (Page Category). Since there are like 60 pages and updating the pages manually can be a big issue. I need to set the pCategory values depending on the pName.
So say a page starts with "C-Sharp" then the category is C#. etc.
I am using SQL Comptact. How can I do this? I try a couple of times to no luck. This is the code I got now but this won't work because it will change all pCategory to same value.
@{
var pCategory = "";
var msg = "";
if (IsPost){
pCategory = Request ["pCategory"];
var SQLINSERT = "INSERT INTO rc_Pages (pCategory) VALUES (@0) ";
var db = Database.Open("razorc");
db.Execute(SQLINSERT, pCategory);
}
}
<form method="post">
@msg
<input type="text" name="pCategory" id="pCategory"/>
<input type="submit" value="Update"/>