به نظر شما تکست باکسی که تو templatefield گذاشتم رو باید جداگونه آپدیت کنم؟
Printable View
به نظر شما تکست باکسی که تو templatefield گذاشتم رو باید جداگونه آپدیت کنم؟
سلام
فکر نمیکنم پارامترها ی شما مشکلی داشته باشند . یک بار دیگه دیتا سورس رو پاک کنید و دوباره کانفیگ کنید ( بدون ریست کردن تمپلیت ) ممکنه حل بشه
دیتاسورس رو هم پاک کردم و دوباره ساختم ،اما نشد..:41:
یکبار دیگه به این کد توجه کنید:
من "text" رو تو textbox قرار دادم،این کد گرید ویو:کد:<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:dbwebConnectionString %>" DeleteCommand="DELETE FROM [news] WHERE [id] = @original_id AND [tarikh] = @original_tarikh AND [titr] = @original_titr AND [text] = @original_text"
InsertCommand="INSERT INTO [news] ([id], [tarikh], [titr], [text]) VALUES (@id, @tarikh, @titr, @text)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [news] ORDER BY [id] DESC"
UpdateCommand="UPDATE [news] SET [tarikh] = @tarikh, [titr] = @titr, [text] = @text WHERE [id] = @original_id AND [tarikh] = @original_tarikh AND [titr] = @original_titr AND [text] = @original_text">
<DeleteParameters>
<asp:Parameter Name="original_id" Type="Decimal" />
<asp:Parameter Name="original_tarikh" Type="String" />
<asp:Parameter Name="original_titr" Type="String" />
<asp:Parameter Name="original_text" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="tarikh" Type="String" />
<asp:Parameter Name="titr" Type="String" />
<asp:Parameter Name="text" Type="String" />
<asp:Parameter Name="original_id" Type="Decimal" />
<asp:Parameter Name="original_tarikh" Type="String" />
<asp:Parameter Name="original_titr" Type="String" />
<asp:Parameter Name="original_text" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="id" Type="Decimal" />
<asp:Parameter Name="tarikh" Type="String" />
<asp:Parameter Name="titr" Type="String" />
<asp:Parameter Name="text" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
حالا واسه آپدیت نباید کار خاصی انجام بدم؟فکر می کنم "text" باید یه فرقی با بقیه داشته باشه!!کد:<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderColor="White" DataSourceID="SqlDataSource1" Font-Names="Tahoma" Font-Size="8pt" Height="500px" Width="746px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True">
<ItemStyle Width="100px" />
</asp:CommandField>
<asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id">
<ItemStyle Width="20px" />
</asp:BoundField>
<asp:BoundField DataField="tarikh" HeaderText="tarikh" SortExpression="tarikh">
<ItemStyle Width="70px" />
</asp:BoundField>
<asp:BoundField DataField="titr" HeaderText="titr" SortExpression="titr">
<ItemStyle Width="156px" />
</asp:BoundField>
<asp:TemplateField HeaderText="متن خبر" SortExpression="text">
<ItemStyle Width="400px" />
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="400px" Height="100" Text='<%# Eval("text") %>' TextMode="MultiLine" Font-Names="Tahoma" Font-Size="8pt"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle Height="50px" />
<EditRowStyle Height="50px" />
</asp:GridView>
تو هر صفحه دیگه ای که گرید ویو می سازم همین مشکلو دارم!!پس به خاطر templatefield که گذاشتم نیست...
نمی دونم چیکار کردم که دیتابیسم اینطوری شده!!!
یه چیز جالب:
بعضی از جداول دیتابیسم این مشکل رو پیدا کرده...
انگار اون جداولی که تو صفحات وبم ازشون استفاده کردم مشکل تو update , delete پیدا کردن...
بعضی هاشون این error رو میدن:
بعضی هاشون هم error نمیدن اما هیچ تغییری پیدا نمی کنن!!!کد:Line 1: Incorrect syntax near '/'. body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } Server Error in '/WebSite2' Application.
Line 1: Incorrect syntax near '/'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '/'.
اون جداولی هم که تا حال ازشون استفاده نکردم هیچ مشکلی ندارن و update میشن...
permission همه جدول ها هم مثل همه...
باید چیکار کنم؟