Tuesday, October 29, 2013

Get & Set!

Success! 

Data comes out! Data goes in! 

The magic words were:

                 db.Clients.Add(Nclient);
       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 a = Request.QueryString["SomeField"];
String Interpolation
 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{
CoDeThAtCrAsHesYoUrApP();

catch{
}
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.

 Week 2 Day 2






 

No comments:

Post a Comment