Click here to Skip to main content
16,004,991 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Asp.net 2.0 dynamically writing a .html file Pin
Jason_Shen26-Apr-09 0:20
Jason_Shen26-Apr-09 0:20 
GeneralRe: Asp.net 2.0 dynamically writing a .html file Pin
Christian Graus26-Apr-09 1:33
protectorChristian Graus26-Apr-09 1:33 
AnswerRe: Asp.net 2.0 dynamically writing a .html file Pin
Perry Holman26-Apr-09 21:49
Perry Holman26-Apr-09 21:49 
QuestionHow can I get email contacts Pin
Shahdat Hosain25-Apr-09 23:06
Shahdat Hosain25-Apr-09 23:06 
AnswerRe: How can I get email contacts Pin
Christian Graus25-Apr-09 23:49
protectorChristian Graus25-Apr-09 23:49 
QuestionHeader Row After Every 10 rows in Gridview Control. Pin
VikashGohil25-Apr-09 21:09
VikashGohil25-Apr-09 21:09 
AnswerRe: Header Row After Every 10 rows in Gridview Control. Pin
Christian Graus25-Apr-09 22:30
protectorChristian Graus25-Apr-09 22:30 
QuestionGridView1_Rowdeleting Query Pin
Roopa Mukherjee25-Apr-09 10:36
Roopa Mukherjee25-Apr-09 10:36 
Hi..i have tried 100000000000 of times to delete a record from GridView..always i got the same error "The GridView 'GridView1' fired event RowDeleting which wasn't handled."

I have set property of GridView..i.e Auto Generate Delete Button


CODE:-


protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{

SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=demomockTest;Integrated Security=True");

SqlDataAdapter da = new SqlDataAdapter("select * from RegisteredHR ", con);

con.Open();

da.DeleteCommand = new SqlCommand("deleterow from RegisteredHR where HRID=", con);
da.DeleteCommand.ExecuteNonQuery();

con.Close();

bindgrid();

}



public void bindgrid()
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=demomockTest;Integrated Security=True");

SqlCommand cmd = new SqlCommand("select * from RegisteredHR ", con);

SqlDataAdapter da = new SqlDataAdapter("", con);

da.SelectCommand = new SqlCommand("select * from RegisteredHR", con);

DataSet ds = new DataSet();

da.Fill(ds, "data");

GridView1.DataSource = ds.Tables[0].DefaultView;

GridView1.DataBind();

}





<asp:linkbutton id="LinkButton1" runat="server" onclick="LinkButton1_Click" width="27px" xmlns:asp="#unknown">See





 <asp:linkbutton id="LinkButton2" runat="server" onclick="LinkButton2_Click" xmlns:asp="#unknown">Select All
      
<asp:label id="Label1" runat="server" backcolor="#FFE0C0" width="62px" xmlns:asp="#unknown">
<asp:gridview id="GridView1" runat="server" xmlns:asp="#unknown">
BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
CellPadding="3" GridLines="Horizontal" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
Width="669px" AutoGenerateDeleteButton="True">
<footerstyle backcolor="#B5C7DE" forecolor="#4A3C8C">
<columns> <asp:templatefield>
<itemtemplate>
<asp:checkbox id="CheckBox1" runat="server">


<rowstyle backcolor="#E7E7FF" forecolor="#4A3C8C">
<selectedrowstyle backcolor="#738A9C" font-bold="True" forecolor="#F7F7F7">
<pagerstyle backcolor="#E7E7FF" forecolor="#4A3C8C" horizontalalign="Right">
<headerstyle backcolor="#4A3C8C" font-bold="True" forecolor="#F7F7F7">
<alternatingrowstyle backcolor="#F7F7F7">







Help me out

Regards

Roopa
AnswerRe: GridView1_Rowdeleting Query Pin
Christian Graus25-Apr-09 11:22
protectorChristian Graus25-Apr-09 11:22 
GeneralRe: GridView1_Rowdeleting Query Pin
Roopa Mukherjee25-Apr-09 20:22
Roopa Mukherjee25-Apr-09 20:22 
GeneralRe: GridView1_Rowdeleting Query Pin
Christian Graus25-Apr-09 22:29
protectorChristian Graus25-Apr-09 22:29 
AnswerRe: GridView1_Rowdeleting Query Pin
Abhijit Jana25-Apr-09 22:36
professionalAbhijit Jana25-Apr-09 22:36 
QuestionEntering value in textfield of any website. Asp.net Pin
maxgit_100025-Apr-09 6:35
maxgit_100025-Apr-09 6:35 
AnswerRe: Entering value in textfield of any website. Asp.net Pin
vaghelabhavesh25-Apr-09 7:18
vaghelabhavesh25-Apr-09 7:18 
GeneralRe: Entering value in textfield of any website. Asp.net Pin
maxgit_100025-Apr-09 7:35
maxgit_100025-Apr-09 7:35 
GeneralRe: Entering value in textfield of any website. Asp.net Pin
vaghelabhavesh25-Apr-09 8:39
vaghelabhavesh25-Apr-09 8:39 
GeneralRe: Entering value in textfield of any website. Asp.net Pin
N a v a n e e t h25-Apr-09 18:36
N a v a n e e t h25-Apr-09 18:36 
GeneralRe: Entering value in textfield of any website. Asp.net Pin
maxgit_100027-Apr-09 5:38
maxgit_100027-Apr-09 5:38 
QuestionPublish a website on the web server? Pin
Subin Alex25-Apr-09 5:52
Subin Alex25-Apr-09 5:52 
AnswerRe: Publish a website on the web server? Pin
vaghelabhavesh25-Apr-09 7:16
vaghelabhavesh25-Apr-09 7:16 
AnswerRe: Publish a website on the web server? Pin
Abhijit Jana25-Apr-09 22:37
professionalAbhijit Jana25-Apr-09 22:37 
GeneralRe: Publish a website on the web server? Pin
Subin Alex26-Apr-09 20:59
Subin Alex26-Apr-09 20:59 
Questionhow to control ur pc with mobile..... Pin
anujchetan25-Apr-09 4:48
anujchetan25-Apr-09 4:48 
AnswerRe: how to control ur pc with mobile..... Pin
Christian Graus25-Apr-09 11:24
protectorChristian Graus25-Apr-09 11:24 
QuestionCould i develop web app without an IIS? Pin
Subin Alex25-Apr-09 2:27
Subin Alex25-Apr-09 2:27 

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.