Click here to Skip to main content
       

C#

 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pinmembertaibc25-Feb-13 4:53 
AnswerRe: The .exe application file isn't obfuscated after installing setup ? PinmemberSamer AlRawi26-Feb-13 17:41 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pinmembertaibc28-Feb-13 14:36 
QuestionC# PinmemberMohanKrishna.Kota24-Feb-13 4:06 
how to perform update and delete operations on a grid view in which the data is already bounded on the time of page load
 
here is my code:
<asp:GridView ID="gvUsers" runat="server" CellPadding="4" ForeColor="#333333"
                GridLines="None" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
                OnRowEditing = "gvUsers_RowEditing" OnRowDeleting = "gvUsers_RowDeleting" OnRowUpdating = "gvUsers_RowUpdating" >
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
 
            </asp:GridView>
 

c# Code:
 
protected void Page_Load(object sender, EventArgs e)
    {
 
        if (Session["Office"] == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            Session.Timeout = 1;
            L1.Text = "District:&nbsp;&nbsp;&nbsp;" + Session["district"].ToString();
            L3.Text = "Department:&nbsp;&nbsp;&nbsp;" + Session["department"].ToString();
            L4.Text = "Office:&nbsp;&nbsp;&nbsp;" + Session["Office"].ToString();
 
            con.Open();
 
            if (Session["department"].ToString() == "NIC")
            {
                SqlCommand cmd1 = new SqlCommand("select * from DeptMaster", con);
                DataSet ds = new DataSet();
                SqlDataAdapter da = new SqlDataAdapter(cmd1);
                SqlCommandBuilder cmb = new SqlCommandBuilder(da);
                da.Fill(ds, "deptmaster");
                gvUsers.DataSource = ds.Tables["deptmaster"];
                gvUsers.DataBind();
            }
            else
            {
                SqlCommand cmd1 = new SqlCommand("select * from OfficeMaster where Office ='" + Session["Office"].ToString() + "'", con);
                DataSet ds = new DataSet();
                SqlDataAdapter da = new SqlDataAdapter(cmd1);
                SqlCommandBuilder cmb = new SqlCommandBuilder(da);
                da.Fill(ds, "deptmaster");
                gvUsers.DataSource = ds.Tables["deptmaster"];
                gvUsers.DataBind();
            }
            con.Close();
        }
    }
Mohan@Coding.com

AnswerASP.NET PinmemberJegan Thiyagesan25-Feb-13 12:14 
General[TUTORIAL] Native Cocoa Apps with C# and MonoMac PinmemberJake Rieger23-Feb-13 14:36 
GeneralRe: [TUTORIAL] Native Cocoa Apps with C# and MonoMac PinmvpDave Kreskowiak23-Feb-13 14:39 
GeneralRe: [TUTORIAL] Native Cocoa Apps with C# and MonoMac PinmemberMycroft Holmes24-Feb-13 18:17 
Questionprograme Pinmemberongwere23-Feb-13 9:35 
AnswerRe: programe PinmemberSoMad23-Feb-13 10:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 23 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid