Click here to Skip to main content
15,913,090 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
minhpc_bk27-Sep-06 15:37
minhpc_bk27-Sep-06 15:37 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish27-Sep-06 22:33
munklefish27-Sep-06 22:33 
AnswerTHE SOLUTION Pin
munklefish27-Sep-06 23:47
munklefish27-Sep-06 23:47 
QuestionDataGrid Display Pin
Dayekh26-Sep-06 5:03
Dayekh26-Sep-06 5:03 
AnswerRe: DataGrid Display Pin
sanju027626-Sep-06 5:20
sanju027626-Sep-06 5:20 
GeneralRe: DataGrid Display Pin
Dayekh26-Sep-06 5:51
Dayekh26-Sep-06 5:51 
AnswerRe: DataGrid Display Pin
Suresh Pirsquare27-Sep-06 0:10
Suresh Pirsquare27-Sep-06 0:10 
QuestionGetting ColumnID Value from GridView? [modified] Pin
sanju027626-Sep-06 4:05
sanju027626-Sep-06 4:05 
Here is the code from ASP.NET 1.1 that works. My problem is below with 2.0 GridView?

private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int playerID = Convert.ToInt32(e.Item.Cells[1].Text);

string sqlDelete = "delete Players where PlayerID = '" + playerID +"'";

SqlConnection conn = new SqlConnection(dsn);
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlDelete;

conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
DataGrid1.EditItemIndex = -1;
BindGrid();
}

This above code is ASP.NET 1.1 code for Deletion from DataGrid. It works fine. Now, I am using GridView (ASP.NET 2.0) The problem I am having is getting the playerID from GridView?

***int playerID = Convert.ToInt32(e.Item.Cells[1].Text); **
does not give any playerID but throws error? How do I get the playerID from GridView. Is the event handler Row Deleting or Row Deleted?

Please help.............
Confused | :confused:



-- modified at 16:34 Wednesday 27th September, 2006

Sanju

AnswerRe: Getting Column Id Value from GridView? Pin
dgonzale26-Sep-06 4:14
dgonzale26-Sep-06 4:14 
GeneralRe: Getting Column Id Value from GridView? Pin
sanju027626-Sep-06 4:17
sanju027626-Sep-06 4:17 
AnswerRe: Getting Column Id Value from GridView? Pin
dgonzale26-Sep-06 4:24
dgonzale26-Sep-06 4:24 
QuestionCrystal Report in ASP.Net 2.0 Pin
Mazdak26-Sep-06 3:56
Mazdak26-Sep-06 3:56 
QuestionFind the Source of PostBack Pin
Jay_se26-Sep-06 3:30
Jay_se26-Sep-06 3:30 
AnswerRe: Find the Source of PostBack Pin
_AK_26-Sep-06 6:50
_AK_26-Sep-06 6:50 
GeneralThanks It Works Fine & One More Query Pin
Jay_se26-Sep-06 20:56
Jay_se26-Sep-06 20:56 
Questiongetting html hidden control's value in code behind Pin
max_dev2006@yahoo.com26-Sep-06 2:41
max_dev2006@yahoo.com26-Sep-06 2:41 
AnswerRe: getting html hidden control's value in code behind Pin
dgonzale26-Sep-06 2:53
dgonzale26-Sep-06 2:53 
AnswerRe: getting html hidden control's value in code behind Pin
Exelioindia26-Sep-06 2:56
Exelioindia26-Sep-06 2:56 
AnswerRe: getting html hidden control's value in code behind Pin
dgonzale26-Sep-06 3:12
dgonzale26-Sep-06 3:12 
AnswerRe: getting html hidden control's value in code behind Pin
Guffa26-Sep-06 3:12
Guffa26-Sep-06 3:12 
AnswerRe: getting html hidden control's value in code behind Pin
dgonzale26-Sep-06 3:19
dgonzale26-Sep-06 3:19 
AnswerRe: getting html hidden control's value in code behind Pin
Guffa26-Sep-06 3:47
Guffa26-Sep-06 3:47 
GeneralRe: getting html hidden control's value in code behind Pin
dgonzale26-Sep-06 3:52
dgonzale26-Sep-06 3:52 
QuestionPOST To a different site in asp.net and vb.net Pin
dgonzale26-Sep-06 2:07
dgonzale26-Sep-06 2:07 
AnswerRe: POST To a different site in asp.net and vb.net Pin
M LN Rao26-Sep-06 2:12
M LN Rao26-Sep-06 2:12 

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.