I do have a ListView which i call from Database ( its selection of data ) in each row i have one Remove, Update Button.
i Bind each button to the ID in listview so when i click it have to return that row value only!
BUT i want to call this value in my query Function to update or Remove the selected Row.
I’m not sure how to call this value into Query.
here is my binding sample:
<Button Name="delete" Click="Delete_Click" CommandParameter="{Binding Path=empID}">
Here is how i call it :
Button _button = (Button)sender;
string empID = _button.CommandParameter.ToString();
\sql stuff
SqlCeConnection con = new SqlCeConnection();
SqlCeDataAdapter ad = new SqlCeDataAdapter();
SqlCeCommand cmd = new SqlCeCommand(empID);
String str = "UPDATE employee SET Isdeleted ='1' WHERE empID= " + empID;
cmd.Parameters.AddWithValue("@empID", empID);
ad.SelectCommand = cmd;
Hope i can get some help as this Query will never worked so far!
Not sure if it will work but u should give it a try, I made it for a local sdf database