Click here to Skip to main content
11,718,016 members (83,431 online)
Rate this: bad
Please Sign up or sign in to vote.
<div style="margin-removed 480px">
        <asp:Label ID="Label1" runat="server" Text="First Name"></asp:Label>
        <asp:TextBox ID="txtfname" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label2" runat="server" Text="Last Name"></asp:Label>
        <asp:TextBox ID="txtlname" runat="server"></asp:TextBox>
 <br />
        <asp:Label ID="Label3" runat="server" Text="EmpId"></asp:Label>
        <asp:TextBox ID="txtempid" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label4" runat="server" Text="D O B"></asp:Label>
        <asp:TextBox ID="txtdob" runat="server"></asp:TextBox>
        <br />
        <br />
        <br />
        <asp:Button ID="btnprev" runat="server" onclick="btnprev_Click" 
            Text="<< Prev" />
        <asp:Button ID="btnsave" runat="server" onclick="btnsave_Click" Text="Save" />
        <asp:Button ID="btnnext" runat="server" onclick="btnnext_Click" 
            Text="Next >>" />
        <br />
        <br />
        <asp:Label ID="lblmsg" runat="server" Text=""></asp:Label>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;
public partial class _Default : System.Web.UI.Page
    DataTable dt;
    int i = 0;
    public void print()
        DataRow dr = dt.Rows[i];
        txtfname.Text = dr[0].ToString();
        txtlname.Text = dr[1].ToString();
        txtempid.Text = dr[2].ToString();
        txtdob.Text = dr[3].ToString();
    protected void Page_Load(object sender, EventArgs e)
    protected void btnsave_Click(object sender, EventArgs e)
        string connStr = WebConfigurationManager.ConnectionStrings["master"].ConnectionString;
        SqlConnection conn = new SqlConnection(connStr);
        SqlCommand cmd = new SqlCommand("insert into employee values('" + txtfname.Text + "','" + txtlname.Text + "','" + txtempid.Text + "','" + txtdob.Text + "')", conn);
        lblmsg.Text = "Successfully Registered";
    protected void btnprev_Click(object sender, EventArgs e)
        i = 0;
    protected void btnnext_Click(object sender, EventArgs e)
        i = dt.Rows.Count - 1;

		<add name="Northwind"
       connectionString="Data Source=JAGADEESHWAR;Initial Catalog=master;Integrated Security=True"
		<compilation debug="true" targetFramework="4.0"/>

Hi Sir

I want to create web application like employee records save,prev,next using northwind connecttions string.

Thanks in advance.
Posted 27-Aug-12 20:09pm
Edited 27-Aug-12 20:53pm
Vani Kulkarni at 28-Aug-12 2:12am
Ok do it. What have you tried? Where are you stuck?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

And what is the issue?

Based on what you say, looks like you need to have a gridview/datalist that has pagination and edit feature.
Start from here:
GridView all in one[^]
Inplace Edit in GridView[^]
MSDN: GridView.AllowPaging Property [^]

Read, Try out, post specific issue if you face.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 874
1 OriginalGriff 215
2 F-ES Sitecore 210
3 Maciej Los 140
4 Jochen Arndt 120
0 Sergey Alexandrovich Kryukov 1,649
1 OriginalGriff 535
2 Maciej Los 529
3 Richard MacCutchan 440
4 CHill60 415

Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 28 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100