PDA

View Full Version : مبتدی: مشکل در حذف اطلاعات در دیتابیس



hjran abdpor
شنبه 08 مرداد 1390, 01:26 صبح
با سلام به دوستان .
من یک گرید ویو دارم که اینجوری ان را پر میکنم :

<asp:GridView ID="dg" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="StfCode" DataSourceID="SqlDataSource1" ForeColor="#333333"
GridLines="None" Width="693px">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:CommandField SelectText="&lt;img src=&quot;Image/delete.gif&quot; border=&quot;0&quot;/&gt;"
ShowSelectButton="True" />
<asp:ImageField DataImageUrlField="Pic_" HeaderText="عکس" ControlStyle-Width="50px" SortExpression="Pic_">
<HeaderStyle Width="50px"></HeaderStyle>

<ItemStyle Width="130px"/>
</asp:ImageField>

<asp:BoundField DataField="Desc_" HeaderText="توضیحات" SortExpression="fDesc" >
<ItemStyle Width="400px" />
</asp:BoundField>
<asp:BoundField DataField="Price_" HeaderText="قیمت" SortExpression="fPrice">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="StfModel" HeaderText="مدل" SortExpression="StfModel">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="StfCode" HeaderText="کد " SortExpression="StfCode">
<ItemStyle Width="130px" />
</asp:BoundField>
<asp:BoundField DataField="StfName" HeaderText="نام " SortExpression="fName">
<ItemStyle Width="130px" />
</asp:BoundField>


</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView></td>




<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString ="<%$ ConnectionStrings:ConnectionStringDB %>"
DeleteCommand="DELETE FROM StuffInfo WHERE (StfCode = @code)"

SelectCommand="Select StfCode,StfName,StfModel,Price_,Desc_ ,Pic_ from StuffInfo " ProviderName ="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>">

<DeleteParameters>
<asp:ControlParameter ControlID="dg" Name="Code" PropertyName="SelectedValue" />
</DeleteParameters>
</asp:SqlDataSource>



این کاراهار ا برای حذف کردن انجام دادم ولی حذف نمیشه ، هیچ خطای هم نمیده !!!:متفکر::متفکر::متفکر::متفکر ::متفکر::متفکر:

مشکل کار کجاست!!!!!!!!
اعضابم خورده شده از این برنامه نویسی.........:اشتباه::اشتباه::ا شتباه::اشتباه:

hjran abdpor
شنبه 08 مرداد 1390, 01:43 صبح
خودم فهمیدم مشکل کجاست.......