Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2007, 08:51 AM
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default FormView Control

Please Anybody can help me with this problem that I am having in FormView Control.

<InsertItemTemplate>
                    <table style="width: 415px">
                    <tr bgcolor="#ffcc66">
                        <td align="right" style="width: 117px"><b>ContractorId:</b>
                        </td>
                        <td>
                            &nbsp;<asp:TextBox ID="InsertContractorIdTextBox"
                                         Text='<%# Bind("ContractorId") %>'
                                         RunAt="server" /></td>
                        <td>
                        </td>
                    </tr>
                    <tr bgcolor="#ffcc66">
                        <td align="right" style="width: 117px"><b>From Language:</b>
                        </td>
                        <td>
                            <asp:TextBox ID="InsertFromLanguageTextBox"
                                         Text='<%# Bind("FromLanguage") %>'
                                         RunAt="server" /></td>
                       <td>
                            &nbsp;<asp:DropDownList DataSourceID="SqlDataSourceLanguages" DataTextField="Language" ID="InsertFromLanguageDDBox" runat="server" DataValueField="Language_ID" Width="155px"></asp:DropDownList></td>
                    </tr>

                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Into Language:</b></td>
                        <td><asp:TextBox ID="InsertIntoLanguageTextBox"
                                         Text='<%# Bind("IntoLanguage") %>'
                                         RunAt="server" /></td>
                                         <td>
                            &nbsp;<asp:DropDownList DataSourceID="SqlDataSourceLanguages" DataTextField="Language" ID="InsertIntoLanguageDDBox" runat="server" DataValueField="Language_ID" Width="155px">
                                         </asp:DropDownList></td>
                    </tr>
                    <tr bgcolor="#ffcc66">
                        <td align="right" style="width: 117px"><b>Service Type:</b></td>
                        <td><asp:TextBox ID="InsertServiceTypeTextBox"
                                         Text='<%# Bind("ServiceTypeId") %>'
                                         RunAt="Server" /></td>
                        <td>

                            <asp:DropDownList ID="DDListServiceType" runat="Server" DataSourceID="SqlDataSourceServiceType" DataTextField="ServiceName"
  DataValueField="ServiceTypeId" Width="157px" >
                            </asp:DropDownList>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Subject:</b></td>
                        <td><asp:TextBox ID="TextBox2"
                                         Text='<%# Bind("Subject") %>'
                                         RunAt="Server" /></td>
                                         <td>
                                         </td>
                    </tr>
                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Desired Rate:</b></td>
                        <td><asp:TextBox ID="TextBox3"
                                         Text='<%# Bind("DesiredRate", "{0:c}") %>'
                                         RunAt="Server" /></td>
                                         <td>
                                         </td>
                    </tr>
                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Desired Unit:</b></td>
                        <td><asp:TextBox ID="TextBox4"
                                         Text='<%# Bind("DesiredUnit", "{0:c}") %>'
                                         RunAt="Server" /></td>
                                         <td>
                                         </td>
                    </tr>
                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Availability:</b></td>
                        <td><asp:TextBox ID="TextBox5"
                                         Text='<%# Bind("Availability") %>'
                                         RunAt="Server" /></td>
                                         <td>
                                         </td>
                    </tr>
                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Period of Unavailability:</b></td>
                        <td><asp:TextBox ID="TextBox6"
                                         Text='<%# Bind("PeriodAvailable") %>'
                                         RunAt="Server" /></td>
                                         <td>
                                         </td>
                    </tr>
                    <tr bgcolor="#ffcc66"><td align="right" style="width: 117px"><b>Note:</b></td>
                        <td><asp:TextBox ID="TextBox7"
                                         Text='<%# Bind("Note") %>'
                                         RunAt="Server" /></td>
                                         <td>
                                         </td>
                    </tr>



                    <tr bgcolor="#ffcc66">
                      <td colspan="2">
                        <asp:LinkButton ID="InsertButton"
                                        Text="Insert"
                                        CommandName="Insert"
                                        RunAt="server"/>
                        &nbsp;
                        <asp:LinkButton ID="CancelInsertButton"
                                        Text="Cancel"
                                        CommandName="Cancel"
                                        RunAt="server"/>
                      </td>
                    </tr>
                  </table>
                </InsertItemTemplate>

Now When I try to Save the record I get Error as follows:

Disallowed implicit conversion from data type nvarchar to data type money, table 'dbo.ContractorsDetail', column 'DesiredRate'. Use the CONVERT function to run this query.

Ok Now. How do I convert String Value to Money in the BIND Property of the control.
Thank you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Panel control in FormView steve35719 ASP.NET 2.0 Basics 5 August 18th, 2010 12:32 AM
Capture and emaio formview control data nuttylife2 ASP.NET 1.x and 2.0 Application Design 0 August 1st, 2006 11:44 AM
Hide a Row in a FormView Control frosty ASP.NET 2.0 Basics 5 July 14th, 2006 03:07 PM
SqlDatasource filter using formview control tony_j_hug ASP.NET 2.0 Basics 2 October 17th, 2005 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.