Subject: asp / atlas
Posted By: cbailey77 Post Date: 4/13/2006 1:34:23 PM
hi,
im trying to create a simple database with Atlas, everything seems ok, I enabled page editing so user(s) can edit on the fly. I have a field in my page called 'Complaints' where the data type is 'nvarchar(50)' .  I want to be able to have this field able to contain a paragraph of two, Is this possible?  I know when it exceeds 50 characters and I try to update the "Complaints" UI on the website (I have it editable) It will crash, so I guess my question is how do increase the characters allowable on this field?


If it cant be done this way does anyone know of a way to keep the format and maybe add some html tag that will display, maybe through a dropdown sticky note kind of deal for the information?



Reply By: cbailey77 Reply Date: 4/13/2006 1:56:22 PM
Can someone move this into an SQL thread, thanks and sorry for the double post.


Reply By: jminatel Reply Date: 4/13/2006 2:14:27 PM
Done.

Jim Minatel
Senior Acquisitions Editor
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Jim's Book of the week: No book this week - Donate to the Red Cross!
Reply By: Imar Reply Date: 4/13/2006 2:25:57 PM
Hi there,

Didn't we do this before?? I mean, you ask the exact same question without providing additional information.

If you need more than 50 characters, you need to increase the size of the column. If you need a lot of characters use text or next instead.

However, the error message you posted seems to suggest some other problem: a foreign key constraint or you have a required column and try to insert a NULL value.

Like I suggested earlier, you need to post your code and your database schema, and explain the basic design of your database.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Reply By: cbailey77 Reply Date: 4/17/2006 8:11:17 AM
Here is the Table Definition - changing Complaint to ntext didnt work for me by the way...

TaskId       int             Unchecked
Name       nvarchar(50)     Checked
Complaint  nvarchar(50)     Checked
Date       smalldatetime Checked
Complete   bit             Checked
        
Below is the code for the page as well.  The database is to collect complaints, dates are the important thing, and the complaint of course..I added a control to allow the user to switch between active complaints and completed ones.   Let me know if more info is needed, thanks in advance...





<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="todo.aspx.cs" Inherits="todo" Title="SCBL - Confederation Bridge" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:LoginView ID="LoginView1" OnViewChanged="LoginView1_ViewChanged" runat="server" >
        <LoggedInTemplate>
            Welcome,
            <asp:LoginName ID="LoginName1" runat="server" />
            !-&nbsp;
            <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="RedirectToLoginPage" />
            &nbsp;&nbsp;
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/ChangePassword.aspx">Change Password</asp:HyperLink>
        </LoggedInTemplate>
        <AnonymousTemplate>
            You are not currently logged in.
        </AnonymousTemplate>
    </asp:LoginView>
    <br />
    <br />
    <h2 style="text-align: left">Confederation Bridge Complaint list<br />
    Status:<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
        <asp:ListItem Value="false">Active</asp:ListItem>
        <asp:ListItem Value="true">Completed</asp:ListItem>
    </asp:DropDownList>
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<img src="cblogo.png" />&nbsp;</h2><asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="TaskId" DataSourceID="ObjectDataSource1" CellPadding="4" GridLines="None" ForeColor="#333333">
        <Columns>
            <asp:CommandField ShowEditButton="True" ShowSelectButton="True" ShowDeleteButton="True" />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="Complaint" HeaderText="Complaint" SortExpression="Complaint" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
            <asp:CheckBoxField DataField="Complete" HeaderText="Complete" SortExpression="Complete" />
        </Columns>
        <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" BorderStyle="Solid" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" Width="300px" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" BorderWidth="950px" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <EditRowStyle BackColor="#999999" />
    </asp:GridView>



    
    &nbsp;&nbsp;
    
    
    <h3>Insert New Complaint
            
    <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False" CellPadding="4" DataKeyNames="TaskId" DataSourceID="ObjectDataSource1" DefaultMode="Insert" ForeColor="#333333" GridLines="None">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="TaskId" HeaderText="TaskId" InsertVisible="False" ReadOnly="True"
                SortExpression="TaskId" />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="Complaint" HeaderText="Complaint" SortExpression="Complaint" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
            <asp:CheckBoxField DataField="Complete" HeaderText="Complete" SortExpression="Complete" />
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:DetailsView>
    &nbsp;&nbsp;&nbsp;&nbsp;
                
            
       
    </h3>
    &nbsp; &nbsp; &nbsp;
    
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetTodoByStatus"
        TypeName="todoTableAdapters.todoTableAdapter" UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_TaskId" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Complaint" Type="String" />
            <asp:Parameter Name="Date" Type="DateTime" />
            <asp:Parameter Name="Complete" Type="Boolean" />
            <asp:Parameter Name="Original_TaskId" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="IsComplete" PropertyName="SelectedValue"
                Type="Boolean" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Complaint" Type="String" />
            <asp:Parameter Name="Date" Type="DateTime" />
            <asp:Parameter Name="Complete" Type="Boolean" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>



Reply By: Imar Reply Date: 4/19/2006 1:52:57 PM
One thing that just popped up: Is the TaskId an identity and an Autonumber field in SQL Server?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Not Here by Kane (Track 7 from the album: As Long As You Want This) What's This?

Go to topic 43090

Return to index page 310
Return to index page 309
Return to index page 308
Return to index page 307
Return to index page 306
Return to index page 305
Return to index page 304
Return to index page 303
Return to index page 302
Return to index page 301