Example of a post back insert using a stored proc. Note I'm not doing any validation here, and if you use this method do a little research on SQL Injection and guard against it.
@if (IsPost) {
var LinkName = Request["LinkName"];
var LinkURL = Request["LinkURL"];
string sQ = String.Format("execute dbo.myprocname @LinkName=\"{0}\",
@LinkURL=\"{1}",LinkName, LinkURL);
db.Execute(sQ);
}
No comments:
Post a Comment