<asp:GridView ID="GridView2" runat="server" DataSourceID="SqlDataSource1">
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BingQiHuaGongConnectionString %>"
SelectCommand="select b.companyname,b.companyType,a.re,b.tel,b.fax,b.webAddress,b.email, a.companyState,a.price,a.scale,a.sl ,a.Pricesl, a.relationkey,a.amount from proandcomp_tb as a inner join companyinfo_tb as b on b.companyKey=a.companykey where a.prokey=@prokey and b.companyType= @companyType order by a.scale desc" DeleteCommand="delete proandComp_tb where relationkey=@relationKey">
<SelectParameters>
<asp:SessionParameter DefaultValue="" Name="proKey" SessionField="proKey" />
<asp:SessionParameter DefaultValue=" " Name="companyType" SessionField="CompanyType" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="relationKey" />
</DeleteParameters>
</asp:SqlDataSource>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BingQiHuaGongConnectionString %>"
SelectCommand="select b.companyname,b.companyType,a.re,b.tel,b.fax,b.webAddress,b.email, a.companyState,a.price,a.scale,a.sl ,a.Pricesl, a.relationkey,a.amount from proandcomp_tb as a inner join companyinfo_tb as b on b.companyKey=a.companykey where a.prokey=@prokey and b.companyType= @companyType order by a.scale desc" DeleteCommand="delete proandComp_tb where relationkey=@relationKey">
<SelectParameters>
<asp:SessionParameter DefaultValue="" Name="proKey" SessionField="proKey" />
<asp:SessionParameter DefaultValue=" " Name="companyType" SessionField="CompanyType" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="relationKey" />
</DeleteParameters>
</asp:SqlDataSource>
【grideview】(把鼠标放上去有个小三角△向右,单击) → 【编辑列】
看看是不是绑定了三列~!
80%应该是你绑定的问题~!