I am trying to insert a new member into database,
when there is a duplicate the catch
block works ok.
But when there is a new member both try
and catch
blocks
return their messages. here is my code.
if (Request["cmd"] == "ins")
{
try{
mydb db = new mydb();
member newm = new member()
{
Id = Request["uid"],
Name = Request["uname"]
};
db.AddTomembers(newm);
db.SaveChanges();
Response.Write("ok");
Response.End();
}
catch(Exception s) {
Response.Write(s);
Response.End();
}
}