Wiizl 0 Light Poster

I have SQL datasource and all columns are directly displayed in gridview.

DS_params.SelectCommand = "SELECT ID, ParamName, ParamValue FROM Params WHERE ProductID=" + pid;
        DS_params.Select(DataSourceSelectArguments.Empty);
        grid_productdata.DataBind();

The first thing I cannot figure out is how to make some column read-only so it can't be edited, without directly adding columns and setting readonly properties.
And the second question- how could I get the ID column value for row being edited? at the moment when i set the UpdateQuery like

UPDATE Params SET ParamName=@ParamName, ParamValue=@ParamValue WHERE ID=@ID

editing updates all records, so how can I get the correct ID to pass?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.