You must Sign In to post a response.
  • Category: ASP.Net MVC

    How to registration and login application using connection string (sqlserver) in ASP.net M

    hai,

    how to registration and login application using connection string (sqlserver) in ASP.net MVC aspx view engine


    please give the answer.

    thanks in advance.
  • #763074
    Hello kavitha.

    You try to implement the design and logic of login and registration, if you face any issue with your code we will help you to solve that.
    But with out even trying if you ask directly for code what is the use. If anyone provides answer then also you wont understand. Simply copying and pasting will not improve you knowledge in programming.

    Sridhar Thota.
    Editor: DNS Forum.

  • #763075

    Hi

    Same Webapplication steps you can use for MVC in sql server C# code


    for ex using this method

    here i mention bind records

    so you can alter the information insert in your db same using as below logic

    Step3:Bind the Records using

    In your view, write or copy/paste code, mentioned in following code-snippet:


    public ActionResult Index()
    {
    sqladp = new SqlDataAdapter("Select * from TblEmp", sqlcon);
    sqladp.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    {
    lstemp.Add(new Employee() { EmpId = int.Parse(dr[0].ToString()), EmpName = dr[1].ToString(), EmpNo = dr[2].ToString() });
    }
    return View(lstemp);
    }


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

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

  • #763082
    Hai Kavitha,
    It should be quite easy and if you create a new application in ASP.Net MVC template, by default it creates the Login and Registration page.
    So you can go through them and check the way it was created. In the same way you can also create the same.
    Hope it will be helpful to you.

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

  • #763112
    thanks for your good responses,



    public ActionResult Index()
    {
    sqladp = new SqlDataAdapter("Select * from TblEmp", sqlcon);
    sqladp.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    {
    lstemp.Add(new Employee() { EmpId = int.Parse(dr[0].ToString()), EmpName = dr[1].ToString(), EmpNo = dr[2].ToString() });
    }
    return View(lstemp);
    }

    please give the sample application of mvc using connection string.

    thanks in advance.

  • #763115
    Hi

    try this code for connection string but if you need pure sql server means you can use this code below i mention code

    Namespace

    using System.Data.Sql;
    using System.Data.SqlClient;



    SqlConnection sqlcon = new SqlConnection("Data Source=PCNAME;Initial catalog=DBNAME;Integrated security=true");
    // integrated security=True menas no need mention user id and pwd otherwise we need this

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

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


Sign In to post your comments