Skip to main content

A start with NerdDinner

Few days and still going on. just a new learner , enthusiast and with the hope of doing better . I am going through this blog just to put a little art of writing in what i have done in learning mvc.
Going through it for about three days , i have gathered a little courage in what i am doing right now.
After a little knowledge in model view and control while going through NerdDinner , I came up to create a view for a controller then a real work out was required .Right now i am going to stop my embarrassing writing and and explain what i went through during the last day in those three days.

Creating a view in mvc gives us the option to create a partial view and a strongly typed view . I haven't gone through the partial view so i would just skip to the strongly typed view . While adding the strongly typed view we get the list of class that we have in the Model. selecting one of the class generates the view that is required to handle the instance field that we have created in the DataRepository. Oh! i forgot to mention that i have used link to sql for the database.
When a strongly typed view is created the View inherits the System.Web.Mvc along with model class.
It looks like this : System.Web.Mvc<NerdDinner.Models.Dinner> This is for my work out with NerdDinner.

What happens when the view is strongly typed is that the view is directly mapped with the related class in the Model . With the strongly typed view the option for the view content is available which generates the required view regarding the specific Model class.This makes the developer think less for the view and give more importance on logic. After the View is generated we call the specific method of the Controller which renders the View in the browser.

This is my first post and the writing might not be clear , the suggestions regarding the post is heartily welcome . 

With regards,
Sushil

Comments

Popular posts from this blog

Using SqlDataAdapter to fill DataTable in c#

public DataTable List(string sql)         {             SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);             SqlCommand cmd = new SqlCommand(sql, con);             DataTable dt = new DataTable();             SqlDataAdapter da = new SqlDataAdapter(cmd);             try             {                              con.Open();                 da.Fill(dt);             }             finally             {                 con.Close();             }             return dt;         }

Pivot in Oracle for Dynamic Columns

Pivot in SQL refers to the change of rows into columns based on specific constraints. An example of pivot could be the transpose of matrix. Example: a matrix containing day as 1st row and sales as 2nd row for  specific day sun    10 mon  20 tue    30 The transpose of the above matrix would be sun mon tue 10  20  30 This is an example scenario of pivot in sql. Now, Lets get on to the actual tables in database and see how we can use pivot . Starting with a fictional scenario, assume a table which contains two columns DAYS and SALES. CREATE TABLE TEST.DAILY_SALES (   DAYS   VARCHAR2(10),   SALES  NUMBER ) insert into DAILY_SALES('SUN',10); insert into DAILY_SALES('MON',20); insert into DAILY_SALES('TUE',15); insert into DAILY_SALES('WED',25); insert into DAILY_SALES('THU',10); insert into DAILY_SALES('FRI',30); insert into DAILY_SALES('SAT',5); Now when we execute the following select statement se