You must Sign In to post a response.
  • Category: Career Guidance

    I want to Learn MVC pattern with Asp.Net. First of all Basics(how to do Insert,Update,Delete)

    Hi Developers ,

    I want to learn MVC pattern with Asp.Net for my Career Growth.
    First of all i want to learn and workout basics. i.e. Insert , Update , Delete Operations.
    i am google it but i can't able to run it like Asp.Net project.

    also i have some questions in Asp.Net Mvc.

    Is it Very Complex to learn Compare with Asp.Net . . . ?
    Can i learn Mvc only with my Asp.Net Knowledge or i have to know anything else . . ?
    How many days it taken to i am practically know basic (insert , update , delete) operations . . ?
    If i Learn Mvc very well na it will useful for me in future .. ?

    i have no idea about mvc . So if anyone know Mvc very well how i am start to learn it . or
    what are the things i need to learn before start Mvc.
    If i buy Asp.Net with Mvc , which name of the author Book is Best.
    in design part my Html Knowledge is Enough or I need to learn Html 5.

    i get confused, so please suggest and guide to how i am Learn MVC Pattern .

    Thanks with
    Paul.S
  • #767615
    Hi
    Paul

    We can easily learn about MVC Basic through net and in our Dynamic Forums (DNS)

    i have mention Code below for MVC (Insert,Update,Delete)


    string connectionstring = "Data source=PCNAME; Initial Catalog=Test; Integrated Security=true";
    SqlConnection conn = new SqlConnection(connectionstring);
    conn.Open();
    SqlCommand comm = new SqlCommand("SELECT * from tst111 where studid=1123", conn);
    SqlDataAdapter da = new SqlDataAdapter(comm);
    DataSet ds = new DataSet();
    da.Fill(ds);
    Grd1.DataSource = ds;
    Grd1.DataBind();
    protected void Btsubmit_Click(object sender, EventArgs e)
    {
    SqlConnection conn = new SqlConnection(connectionstring);
    conn.Open();
    SqlCommand comm = new SqlCommand("Insert into StudentEnq values("+ TxtStudId.Text + ",'"+ TxtName.Text + "')",conn);
    int Result=comm.ExecuteNonQuery();
    }

    protected void Submit_Click(object sender, EventArgs e)
    {

    SqlConnection con = new SqlConnection(connectionstring);
    SqlCommand cmd = new SqlCommand("AddStudInfo", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add("@StudId", SqlDbType.Int).Value = Convert.ToInt32(TxtStudId.Text);
    cmd.Parameters.Add("@studname", SqlDbType.VarChar, 50).Value = TxtName.Text.ToString();
    con.Open();
    int Result=cmd.ExecuteNonQuery();
    con.Close();
    }



    Html Code



    <table>
    <tr>
    <td>
    Student ID
    </td>
    <td>
    <asp:TextBox ID="TxtStudId" runat ="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>
    Student Name
    </td>
    <td>
    <asp:TextBox ID="TxtName" runat ="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <asp:Button ID="Btsubmit" runat ="server" Text ="Submit" OnClick="Btsubmit_Click" />
    <asp:Button ID="Submit" runat ="server" Text ="Stored Proc" OnClick="Submit_Click" />
    </td>
    </tr>
    </table>



    WebConfig


    <connectionStrings>
    <add name="TestConnectionString" connectionString="Data Source=PCNAME;Initial Catalog=Test;Integrated Security=True" providerName="System.Data.SqlClient" >
    </connectionStrings>




    SqlConnection MyConn = new SqlConnection("server=PCNAME;database=Test;Integrated Security=SSPI");
    SqlCommand command = MyConn.CreateCommand();
    MyConn.Open();
    command = new SqlCommand("SELECT * FROM TblEmp", MyConn);
    using (SqlDataReader reader = command.ExecuteReader())
    {
    Console.WriteLine("Emp Id\t\t\t\t\t Name \t\t\t\t\t\t EmpNo\t");
    while (reader.Read())
    {
    Console.WriteLine(String.Format("{0} \t\t\t | {1} \t | {2}",
    reader[0], reader[1], reader[2]));
    }
    }
    Console.WriteLine("Data displayed! Now press enter to move to the next section!");
    Console.ReadLine();
    Console.Clear();
    MyConn.Close();



    View code this



    <div class="form-horizontal">
    <h4>StudentEnq</h4>
    <hr />
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    <div class="form-group">
    @Html.LabelFor(model => model.StudId, htmlAttributes: new { @class = "control-label col-md-2" })
    <div class="col-md-10">
    @Html.EditorFor(model => model.StudId, new { htmlAttributes = new { @class = "form-control" } })
    @Html.ValidationMessageFor(model => model.StudId, "", new { @class = "text-danger" })
    </div>
    </div>

    <div class="form-group">
    @Html.LabelFor(model => model.StudName, htmlAttributes: new { @class = "control-label col-md-2" })
    <div class="col-md-10">
    @Html.EditorFor(model => model.StudName, new { htmlAttributes = new { @class = "form-control" } })
    @Html.ValidationMessageFor(model => model.StudName, "", new { @class = "text-danger" })
    </div>
    </div>

    <div class="form-group">
    <div class="col-md-offset-2 col-md-10">
    <input type="submit" value="Create" class="btn btn-default" />
    </div>
    </div>
    </div>


    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #767620
    ASP.NET is a technology stack that has been around for a while, its latest incarnation being ASP.NET MVC, ASP.NET MVC is fashioned after the Model-View-Controller design pattern. It gives you a clean-cut separation of concerns and testable code. What I love the most about this pattern is that it embraces the web. Controllers act like URL routers, and fit well in a RESTful paradigm. When you see /Account/Login
    see below links for more details
    http://www.codeproject.com/Articles/891745/Getting-Started-with-ASP-NET-MVC
    https://msdn.microsoft.com/en-us/magazine/jj991978.aspx

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #767624

    Hi Paul,

    Now a days everybody expect .net with MVC, pure webapplication no one is looking, so we have to move with the trend. In Microsoft one of the best learning course is MVC you are already in webapplication development as of my knowledge this is the best foundation to grow up your skills in MVC with your ASP.net knowledge, if you want to know basics then m,y suggestion is go through the ShivPrasad Koirala, articles that was helps you more to understood about MVC and architecture. You can able to learn it with in a week if you follow his guidance, you get all the basics by referring below article for sure, "codeproject.com/Articles/866143/Learn-MVC-Project-in-days-Day"


    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #767632
    i thing i want to jump any other company i can't able to jump with having only knowledge in Asp.Net.
    So MVC is Must for my Career and my Future. Am Right..?

    Thanks for all your wonderful reply friends.
    i have no idea even 2 days ago.
    but now i have lot of ideas to how to learn MVC .
    what is the value of MVC Technology too.
    i must try your Suggestion regularly then in future if i have any doubt let me know your all.

    Thanks and Regards
    Paul.S

  • #767693

    Hai Paul Raj,
    Please find below answers for your questions:

    Q. Is it Very Complex to learn Compare with Asp.Net . . . ?
    A. The answer is NO. Leaning MVC is quite easy and it is not as much complex as people think. The only difficult part might be the JQuery and JavaScript. So if the person is aware of JQuery and JavaScript it will be easy to do all the things.

    Q. Can i learn MVC only with my Asp.Net Knowledge or i have to know anything else . . ?
    A. You don't need any separate knowledge to learn the MVC. If you are aware of ASP.net and 3-tier architecture, it is enough to go with it. Just go through some JQuery and JavaScript concept which will help.

    Q. How many days it taken to i am practically know basic (insert , update , delete) operations . . ?
    A. It's all depends on you how fast you grab the things. But i think 15-20 days are enough to learn all the basics with the CRUD operations.

    Q. If i Learn MVC very well, it will useful for me in future .. ?
    A. Yes Definitely it will be helpful as you will not only learn the MVC, it will help in all the future technologies which depends on MVC like AngularJS, SPA, NodeJS also will be helpful. Because you are learning at the same time the JQuery and other scripting languages.

    Q. If i buy Asp.Net with MVC , which name of the author Book is Best.
    A. MVC is not as big as you think about ASP.Net. If you already know about the ASP.Net and 3-tier architecture, it is quite easy to start with the ASP.Net MVC which is just the extension of ASP.Net
    In MVC, you will use the similar concepts but in different ways of implementation.

    Q. In design part my Html Knowledge is Enough or I need to learn Html 5.
    A. You don't need to learn HTML 5 specially for MVC. But if you know its always good but not required.
    Hope it will be helpful to you.


    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #767708
    Thanks Mr.Pawan Awasthi
    Thanks a lot for your Brief Explaining for my all Quetions.
    Now i have cleared my lot of doubts soooo.

    Paul.S

  • #767714
    It is not very difficult to learn. Anyway you have good knowledge of ASP.net. so it is easy to understand MVC. You can concentrate the following.
    1. In the Database side you can use "Entity Framework". It will handle your database side. If you familiarize with this, no issues you can use your ado.net for back end.
    2. In build templates are available for "CRUD. So you do not worry about your starting stage. Then you can go little bit deep on this.
    3. You need to study some of the techniques like "Routing"
    4. Then as everybody told learn the concept of Model-View-Controller.

    It is like very old concept ASP scripts (View). Event concept is completly removed.

    By Nathan
    Direction is important than speed

  • #767716
    thanks for your Valuable Reply Mr.Nathan i have to improve a lot in Ado.Net and Routing

    Paul.S


Sign In to post your comments