Problem in UPDATE query in GridView

S

Saber

I have a gridview:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"
DataKeyNames="ADid">

and it is my update query:

UPDATE tblAds SET ADName = @ADname, ADType = @ADType, ADPriority =
@ADPriority FROM tblAds INNER JOIN tblCategories ON tblAds.ADCatID =
tblCategories.CatID WHERE tblAds.ADid = @ADid

When I try to update a field, I get an error message:
Must declare the variable '@ADid'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top