Error : Does not have same signature as delegate
-
Its a user defined function and I am calling it on the selected index changed event of datagrid.
Rock Star
In Your aspx page u can see, in the GV code, Following line
OnSelectedIndexChanged="Generic_DG_SelectedIndexChanged3"
Delete it. The function that you created is already attached to GV that is the problem. And call this function inside the GV'sSelectedIndexChanged
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
In Your aspx page u can see, in the GV code, Following line
OnSelectedIndexChanged="Generic_DG_SelectedIndexChanged3"
Delete it. The function that you created is already attached to GV that is the problem. And call this function inside the GV'sSelectedIndexChanged
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
Hi, I did it what you have mentioned but by deleting it for understanding the flow I have kept a msgbox in the function but it is not calling the Generic_DG_SelectedIndexChanged3 function becauuse it is not showing that msgbox too. One more thing I didnt understood your last comment i.e "And call this function inside the GV's SelectedIndexChanged "
Rock Star
-
Hi, I did it what you have mentioned but by deleting it for understanding the flow I have kept a msgbox in the function but it is not calling the Generic_DG_SelectedIndexChanged3 function becauuse it is not showing that msgbox too. One more thing I didnt understood your last comment i.e "And call this function inside the GV's SelectedIndexChanged "
Rock Star
When you pass a
DataGridCommandEventArgs
to a function you can assign that function only to OnEditCommand,OnUpdateCommand,OnItemCommand etc... I dont think there is a command event forSelectedIndexChanged.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
Hi, I did it what you have mentioned but by deleting it for understanding the flow I have kept a msgbox in the function but it is not calling the Generic_DG_SelectedIndexChanged3 function becauuse it is not showing that msgbox too. One more thing I didnt understood your last comment i.e "And call this function inside the GV's SelectedIndexChanged "
Rock Star
1.You can change your code that work with,
SelectedIndexChanged
of grid view. Dim index As Integer = Generic_DG.SelectedIndex cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(index).Value.ToString()EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
When you pass a
DataGridCommandEventArgs
to a function you can assign that function only to OnEditCommand,OnUpdateCommand,OnItemCommand etc... I dont think there is a command event forSelectedIndexChanged.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
1.You can change your code that work with,
SelectedIndexChanged
of grid view. Dim index As Integer = Generic_DG.SelectedIndex cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(index).Value.ToString()EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
Thanx it is running now but i m getting error as {"Must declare the scalar variable "@ProdId"."} for the code adapt.Fill(DT_DS, "Test") How can I declase avariable @prodID as a scalar variable?
Rock Star
Change the following line.
cmd.CommandText = "select * from products where ProdID=@rodID"
Tocmd.CommandText = "select * from products where ProdID=" & Generic_DG.DataKeys(index).Value.ToString()
and delete the following line.cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(e.Item.ItemIndex)
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
Change the following line.
cmd.CommandText = "select * from products where ProdID=@rodID"
Tocmd.CommandText = "select * from products where ProdID=" & Generic_DG.DataKeys(index).Value.ToString()
and delete the following line.cmd.Parameters.Add("@ProdId", SqlDbType.Int).Value = Generic_DG.DataKeys(e.Item.ItemIndex)
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
Hi, Thanx a lot for helping me and giving your precious time to solve this bug. I am trying few more things on it.
Rock Star
Good Luck :)
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
Good Luck :)
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
Hi, I am trying some more operation on the details view. But I am getting some problem in it is specified in the following link http://www.codeproject.com/script/Forums/View.aspx?fid=12076 with the subject line as "Edit the data in a detail view at run time [modified]"
Rock Star