I have host-asp web-server. I wanto use form view for insert ,delete and edit. When I use My computer Connection string code is working but when I use server connection string it does not give me any error or does not show form view so please help me
but when I use server connection string it does not give me any error or does not show form view so please help me
Please try to connect to your database on your remote server file first by opening VS,in the "View" menu plz open "Solution Explorer" and then create a connection,if that OK,plz copy the conn string directly from the right-down property panel and paste into
your own web.config,that'd be OK with you。
Pankil
Member
141 Points
77 Posts
How to Run Form View in Web-server
Feb 19, 2012 03:21 AM|LINK
<asp:FormView ID="FormView1" runat="server" AllowPaging="True" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" Caption="Add/Edit/Delete A Event" CellPadding="3" DataKeyNames="id" DataSourceID="edcalls" EmptyDataText="Please Enter some data" GridLines="Vertical" HeaderText="Event Detail" Width="406px" Height="208px"> <EditItemTemplate> id: <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>' /> <br /> event_name: <asp:TextBox ID="event_nameTextBox" runat="server" Text='<%# Bind("event_name") %>' /> <br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </EditItemTemplate> <EditRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /> <InsertItemTemplate> event_name: <asp:TextBox ID="event_nameTextBox" runat="server" Text='<%# Bind("event_name") %>' /> <br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> id: <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' /> <br /> event_name: <asp:Label ID="event_nameLabel" runat="server" Text='<%# Bind("event_name") %>' /> <br /> <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="New" /> </ItemTemplate> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> </asp:FormView> <asp:SqlDataSource ID="edcalls" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:abcd %> " DeleteCommand="DELETE FROM [event1] WHERE [id] = @original_id AND (([event name] = @original_event_name) OR ([event name] IS NULL AND @original_event_name IS NULL))" InsertCommand="INSERT INTO [event1] ([event name]) VALUES (@event_name)" OldValuesParameterFormatString="original_{0}" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [id], [event name] AS event_name FROM [event1]" UpdateCommand="UPDATE [event1] SET [event name] = @event_name WHERE [id] = @original_id AND (([event name] = @original_event_name) OR ([event name] IS NULL AND @original_event_name IS NULL))"> <DeleteParameters> <asp:Parameter Name="original_id" Type="Int32" /> <asp:Parameter Name="original_event_name" Type="String" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="event_name" Type="String" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="event_name" Type="String" /> <asp:Parameter Name="original_id" Type="Int32" /> <asp:Parameter Name="original_event_name" Type="String" /> </UpdateParameters> </asp:SqlDataSource>Pankil
Pankil
Member
141 Points
77 Posts
Re: How to Run Form View in Web-server
Feb 19, 2012 03:24 AM|LINK
Hello
I have host-asp web-server. I wanto use form view for insert ,delete and edit. When I use My computer Connection string code is working but when I use server connection string it does not give me any error or does not show form view so please help me
Pankil
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: How to Run Form View in Web-server
Feb 21, 2012 12:44 AM|LINK
Please try to connect to your database on your remote server file first by opening VS,in the "View" menu plz open "Solution Explorer" and then create a connection,if that OK,plz copy the conn string directly from the right-down property panel and paste into your own web.config,that'd be OK with you。
Reguards!