Success!
Data comes out! Data goes in!
The magic words were:
db.Clients.Add(Nclient);
db.SaveChanges();
db.SaveChanges();
It's a little more complicated than that but that's what I was missing. While banging my head against the problem I got the following points.
How to Access Information Returned In A Query String
String Interpolationstring a = Request.QueryString["SomeField"];
string a = string.Format("{0} {1}!","Hello", "World");You can also use variables:
string h = "Hello";
string w = "World";
string a = string.Format("{} {}!", h, w);
Catching Errors: (Sometimes) Keeping Errors from Crashing Your Program
try{The code in try runs and is a success or fails, if it fails then we can handle the error in the catch section. I need more work on this but it's an interesting starting point.
CoDeThAtCrAsHesYoUrApP();
}
catch{
}
Week 2 Day 2
No comments:
Post a Comment