Click here to Skip to main content
13,292,205 members (58,067 online)
   

C#

 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 2:07
membershoab.shah27-Feb-13 2:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan27-Feb-13 4:46
mvpRichard MacCutchan27-Feb-13 4:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak27-Feb-13 2:07
mvpDave Kreskowiak27-Feb-13 2:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 2:10
membershoab.shah27-Feb-13 2:10 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak27-Feb-13 2:19
mvpDave Kreskowiak27-Feb-13 2:19 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 20:07
membershoab.shah27-Feb-13 20:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak28-Feb-13 2:29
mvpDave Kreskowiak28-Feb-13 2:29 
QuestionForce Beep...! Pin
Jassim Rahma25-Feb-13 3:57
memberJassim Rahma25-Feb-13 3:57 
AnswerRe: Force Beep...! Pin
Richard MacCutchan25-Feb-13 4:09
mvpRichard MacCutchan25-Feb-13 4:09 
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 
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 
Questionunable to start program, unrecognized error in windows web services framework Pin
bonosa23-Feb-13 6:06
memberbonosa23-Feb-13 6:06 
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 
GeneralRe: sourceafis probleme Pin
arissem22-Feb-13 9:55
memberarissem22-Feb-13 9:55 
GeneralRe: sourceafis probleme Pin
Dave Kreskowiak22-Feb-13 10:26
mvpDave Kreskowiak22-Feb-13 10:26 
GeneralRe: sourceafis probleme Pin
arissem23-Feb-13 4:21
memberarissem23-Feb-13 4:21 
GeneralRe: sourceafis probleme Pin
Dave Kreskowiak23-Feb-13 5:19
mvpDave Kreskowiak23-Feb-13 5:19 
GeneralRe: sourceafis probleme Pin
arissem23-Feb-13 7:48
memberarissem23-Feb-13 7:48 
GeneralRe: sourceafis probleme Pin
Dave Kreskowiak23-Feb-13 9:10
mvpDave Kreskowiak23-Feb-13 9:10 
Questionfile transer using wifi with out socket programming in c# Pin
raythatha722-Feb-13 0:02
memberraythatha722-Feb-13 0:02 
SuggestionRe: file transer using wifi with out socket programming in c# Pin
Richard MacCutchan22-Feb-13 0:56
mvpRichard MacCutchan22-Feb-13 0:56 
GeneralRe: file transer using wifi with out socket programming in c# Pin
raythatha71-Mar-13 0:25
memberraythatha71-Mar-13 0:25 
GeneralRe: file transer using wifi with out socket programming in c# Pin
Richard MacCutchan1-Mar-13 1:36
mvpRichard MacCutchan1-Mar-13 1:36 
AnswerRe: file transer using wifi with out socket programming in c# Pin
Eddy Vluggen22-Feb-13 1:28
mvpEddy Vluggen22-Feb-13 1:28 
AnswerRe: file transer using wifi with out socket programming in c# Pin
Dave Kreskowiak22-Feb-13 2:51
mvpDave Kreskowiak22-Feb-13 2:51 
Questionneed full tutorial for making audio player in C# Pin
Chaman Saini21-Feb-13 8:58
memberChaman Saini21-Feb-13 8:58 
AnswerRe: need full tutorial for making audio player in C# Pin
Eddy Vluggen21-Feb-13 9:37
mvpEddy Vluggen21-Feb-13 9:37 
AnswerRe: need full tutorial for making audio player in C# Pin
Abhinav S21-Feb-13 16:36
mvpAbhinav S21-Feb-13 16:36 
AnswerRe: need full tutorial for making audio player in C# Pin
Amir Mohammad Nasrollahi29-Jul-13 22:53
professionalAmir Mohammad Nasrollahi29-Jul-13 22:53 
Questionsimple audio player in C# Pin
Chaman Saini21-Feb-13 6:07
memberChaman Saini21-Feb-13 6:07 
AnswerRe: simple audio player in C# Pin
Pete O'Hanlon21-Feb-13 6:35
protectorPete O'Hanlon21-Feb-13 6:35 
GeneralRe: simple audio player in C# Pin
Chaman Saini21-Feb-13 6:50
memberChaman Saini21-Feb-13 6:50 
GeneralRe: simple audio player in C# Pin
Dave Kreskowiak21-Feb-13 7:04
mvpDave Kreskowiak21-Feb-13 7:04 
GeneralRe: simple audio player in C# Pin
Chaman Saini21-Feb-13 7:10
memberChaman Saini21-Feb-13 7:10 
GeneralRe: simple audio player in C# Pin
Chaman Saini21-Feb-13 7:14
memberChaman Saini21-Feb-13 7:14 
GeneralRe: simple audio player in C# Pin
Dave Kreskowiak21-Feb-13 13:32
mvpDave Kreskowiak21-Feb-13 13:32 
AnswerRe: simple audio player in C# Pin
Richard MacCutchan21-Feb-13 7:32
mvpRichard MacCutchan21-Feb-13 7:32 
QuestionC# WPF Memory Leak Pin
micwu20-Feb-13 22:54
membermicwu20-Feb-13 22:54 
AnswerRe: C# WPF Memory Leak Pin
Abhinav S20-Feb-13 23:30
mvpAbhinav S20-Feb-13 23:30 
AnswerRe: C# WPF Memory Leak Pin
Keith Barrow21-Feb-13 0:37
mentorKeith Barrow21-Feb-13 0:37 
AnswerRe: C# WPF Memory Leak Pin
Pete O'Hanlon21-Feb-13 0:46
protectorPete O'Hanlon21-Feb-13 0:46 
GeneralRe: C# WPF Memory Leak Pin
Wu Bin Michael21-Feb-13 16:03
memberWu Bin Michael21-Feb-13 16:03 
GeneralRe: C# WPF Memory Leak Pin
Pete O'Hanlon21-Feb-13 21:28
protectorPete O'Hanlon21-Feb-13 21:28 
AnswerRe: C# WPF Memory Leak Pin
Dave Kreskowiak21-Feb-13 3:28
mvpDave Kreskowiak21-Feb-13 3:28 
GeneralRe: C# WPF Memory Leak Pin
Wu Bin Michael21-Feb-13 15:54
memberWu Bin Michael21-Feb-13 15:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 |
Web04 | 2.8.171207.1 | Last Updated 12 Dec 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid