Filling, Editing, Updating, Deleting from a GridView is quite easy now. Just follow these steps. 1. Open Visual Studio create a web based project. 2. Go to design view of Default.aspx page and then drag&drop a GridView control from standard Visual Studio Toolbox. 3.Right click on GridView goto properties and then disable AutoGeneratedColumns property to false. 4. Navigate to your source page (default.aspx). then we will found the tags look like asp:gridview id="GridView1" runat="server" autogeneratecolumns="False"> 5. Now, open tab in gridview and wirte the following code. 6. Save the File. Now goto your codebehind file(Default.aspx.cs) 7. Replace your Page_Load event with the following protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillgrid(); } } 8. And write the Grid method private void fillgrid() { con.Open(); da = new SqlDataAdapter("select * from login", con...
C#, ASP.NET, SQL SERVER, CSS, HTML, examples and tutorials