Index.cshtml
index.cshtml
homeController.cs
string s=ConfigurationManager.ConnectionStrings["constr"].ConnectionString; string sel = "select * from TableName"; SqlConnection con = new SqlConnection(s); SqlCommand cmd = new SqlCommand(sel, con); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind();
Model
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)