Click here to Skip to main content
11,415,164 members (73,229 online)
   

C#

 
AnswerRe: Force Beep...! Pin
Dave Kreskowiak25-Feb-13 4:56
mvpDave Kreskowiak25-Feb-13 4:56 
AnswerRe: Force Beep...! Pin
PIEBALDconsult25-Feb-13 5:32
memberPIEBALDconsult25-Feb-13 5:32 
AnswerRe: Force Beep...! Pin
Eddy Vluggen25-Feb-13 9:04
mvpEddy Vluggen25-Feb-13 9:04 
AnswerRe: Force Beep...! Pin
Amir Mohammad Nasrollahi29-Jul-13 22:38
professionalAmir Mohammad Nasrollahi29-Jul-13 22:38 
QuestionASP.NET UserControl In UserControl Pin
thekoko8924-Feb-13 17:30
memberthekoko8924-Feb-13 17:30 
AnswerCrosspost Pin
SoMad24-Feb-13 17:47
memberSoMad24-Feb-13 17:47 
QuestionThe .exe application file isn't obfuscated after installing setup ? Pin
taibc24-Feb-13 5:21
membertaibc24-Feb-13 5:21 
AnswerRe: The .exe application file isn't obfuscated after installing setup ? Pin
Pete O'Hanlon25-Feb-13 2:58
protectorPete O'Hanlon25-Feb-13 2:58 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
taibc25-Feb-13 4:12
membertaibc25-Feb-13 4:12 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
Pete O'Hanlon25-Feb-13 5:43
protectorPete O'Hanlon25-Feb-13 5:43 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
taibc25-Feb-13 5:53
membertaibc25-Feb-13 5:53 
AnswerRe: The .exe application file isn't obfuscated after installing setup ? Pin
Samer AlRawi26-Feb-13 18:41
memberSamer AlRawi26-Feb-13 18:41 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
taibc28-Feb-13 15:36
membertaibc28-Feb-13 15:36 
QuestionC# Pin
MohanKrishna.Kota24-Feb-13 5:06
memberMohanKrishna.Kota24-Feb-13 5: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 Pin
Jegan Thiyagesan25-Feb-13 13:14
memberJegan Thiyagesan25-Feb-13 13:14 
General[TUTORIAL] Native Cocoa Apps with C# and MonoMac Pin
Jake Rieger23-Feb-13 15:36
memberJake Rieger23-Feb-13 15:36 
GeneralRe: [TUTORIAL] Native Cocoa Apps with C# and MonoMac Pin
Dave Kreskowiak23-Feb-13 15:39
mvpDave Kreskowiak23-Feb-13 15:39 
GeneralRe: [TUTORIAL] Native Cocoa Apps with C# and MonoMac Pin
Mycroft Holmes24-Feb-13 19:17
memberMycroft Holmes24-Feb-13 19:17 
Questionprograme Pin
ongwere23-Feb-13 10:35
memberongwere23-Feb-13 10:35 
AnswerRe: programe Pin
SoMad23-Feb-13 11:37
memberSoMad23-Feb-13 11:37 
GeneralRe: programe Pin
Manfred R. Bihy23-Feb-13 12:37
memberManfred R. Bihy23-Feb-13 12:37 
GeneralRe: programe Pin
SoMad23-Feb-13 12:46
memberSoMad23-Feb-13 12:46 
AnswerRe: programe Pin
Amir Mohammad Nasrollahi29-Jul-13 22:45
professionalAmir Mohammad Nasrollahi29-Jul-13 22:45 
QuestionCustomize windows scroll bar in combobox Pin
Kaizen20223-Feb-13 8:45
memberKaizen20223-Feb-13 8:45 
AnswerRe: Customize windows scroll bar in combobox Pin
SledgeHammer0123-Feb-13 10:20
memberSledgeHammer0123-Feb-13 10:20 
GeneralRe: Customize windows scroll bar in combobox Pin
Kaizen20224-Feb-13 7:01
memberKaizen20224-Feb-13 7:01 
GeneralRe: Customize windows scroll bar in combobox Pin
SledgeHammer0124-Feb-13 9:20
memberSledgeHammer0124-Feb-13 9:20 
Questionunable to start program, unrecognized error in windows web services framework Pin
bonosa23-Feb-13 6:06
memberbonosa23-Feb-13 6:06 
Questionwhy System.NullReferenceException occurred? Pin
Jassim Rahma23-Feb-13 2:54
memberJassim Rahma23-Feb-13 2:54 
AnswerRe: why System.NullReferenceException occurred? Pin
Alan N23-Feb-13 3:04
memberAlan N23-Feb-13 3:04 
GeneralRe: why System.NullReferenceException occurred? Pin
Jassim Rahma23-Feb-13 3:10
memberJassim Rahma23-Feb-13 3:10 
GeneralRe: why System.NullReferenceException occurred? Pin
Alan N23-Feb-13 3:33
memberAlan N23-Feb-13 3:33 
GeneralRe: why System.NullReferenceException occurred? Pin
Jassim Rahma23-Feb-13 3:44
memberJassim Rahma23-Feb-13 3:44 
GeneralRe: why System.NullReferenceException occurred? Pin
Alan N23-Feb-13 3:54
memberAlan N23-Feb-13 3:54 
AnswerRe: why System.NullReferenceException occurred? Pin
jschell24-Feb-13 8:05
memberjschell24-Feb-13 8:05 
QuestionHow to read gmail mails using C# (only Unread Email ) [modified] Pin
AeroIT22-Feb-13 19:13
groupAeroIT22-Feb-13 19:13 
AnswerRe: How to read gmail mails using C# (only Unread Email ) Pin
Dave Kreskowiak22-Feb-13 19:22
mvpDave Kreskowiak22-Feb-13 19:22 
AnswerRe: How to read gmail mails using C# (only Unread Email ) Pin
OriginalGriff22-Feb-13 22:42
mvpOriginalGriff22-Feb-13 22:42 
AnswerRe: How to read gmail mails using C# (only Unread Email ) Pin
Marco Bertschi23-Feb-13 9:02
memberMarco Bertschi23-Feb-13 9:02 
AnswerRe: How to read gmail mails using C# (only Unread Email ) [modified] Pin
Amir Mohammad Nasrollahi29-Jul-13 22:51
professionalAmir Mohammad Nasrollahi29-Jul-13 22:51 
Questionsimplest hacking software in C# Pin
Member 985741522-Feb-13 17:44
memberMember 985741522-Feb-13 17:44 
AnswerRe: simplest hacking software in C# Pin
Dave Kreskowiak22-Feb-13 19:21
mvpDave Kreskowiak22-Feb-13 19:21 
AnswerRe: simplest hacking software in C# Pin
SoMad22-Feb-13 20:13
memberSoMad22-Feb-13 20:13 
AnswerRe: simplest hacking software in C# Pin
OriginalGriff22-Feb-13 22:44
mvpOriginalGriff22-Feb-13 22:44 
GeneralRe: simplest hacking software in C# Pin
Jibesh22-Feb-13 23:46
memberJibesh22-Feb-13 23:46 
GeneralRe: simplest hacking software in C# Pin
Shubh Agrahari23-Feb-13 3:03
memberShubh Agrahari23-Feb-13 3:03 
AnswerRe: simplest hacking software in C# Pin
Marco Bertschi23-Feb-13 9:04
memberMarco Bertschi23-Feb-13 9:04 
AnswerRe: simplest hacking software in C# Pin
V.25-Feb-13 1:25
memberV.25-Feb-13 1:25 
Questionsourceafis probleme Pin
arissem22-Feb-13 9:02
memberarissem22-Feb-13 9:02 
AnswerRe: sourceafis probleme Pin
Dave Kreskowiak22-Feb-13 9:47
mvpDave Kreskowiak22-Feb-13 9:47 

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.150427.4 | Last Updated 27 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid