in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Getting Error "Data at the root level is invalid. Line 1, position 1."

Last post 10-27-2007 7:29 AM by Sehul Soni. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-23-2007 7:55 AM

    Getting Error "Data at the root level is invalid. Line 1, position 1."

    Hi,

     Anyone can help me ?

    I take one WebSchedule in my Form and I want to just disply one Table Data on perticular Dates regarding that Table's date column.

    For that I set Appointment Sorege with DataSource.

    I set DisplyView is MonthView.

    I set All Edit Option Close.

    The Error is : "Data at the root level is invalid. Line 1, position 1."

    I set Id property as my Table's Primary Key Column "SeminarId" which is Autoincremented datatype.

     

    Waiting for reply.

     Thanks

    Sehul

  • 10-24-2007 9:22 AM In reply to

    Re: Getting Error "Data at the root level is invalid. Line 1, position 1."

    Try following configuration, this must work. If it does not work then please attach a sample that replicates the issue. The Id field in your table should be of GUID type.
    ------------------
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                SelectCommand="SELECT * FROM [Appointments]"
                InsertCommand="INSERT INTO [Appointments] (Id, Body, ApptEnd, Location, Start, Subject, Properties) VALUES (@Id, @Body,
    @ApptEnd, @Location, @Start, @Subject, @Properties)"
                UpdateCommand="UPDATE [Appointments] SET Body=@Body, ApptEnd=@ApptEnd, Location=@Location, Start=@Start, Subject=@Subject,
    Properties=@Properties WHERE Id=@Id"
                DeleteCommand="DELETE FROM [Appointments] WHERE Id=@Id"
                SelectCommandType="Text" InsertCommandType="Text" UpdateCommandType="Text" DeleteCommandType="Text">
                <DeleteParameters>
                    <asp:Parameter Name="Id" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Body" Type="String" />
                    <asp:Parameter Name="ApptEnd" Type="DateTime" />
                    <asp:Parameter Name="Location" Type="String" />
                    <asp:Parameter Name="Start" Type="DateTime" />
                    <asp:Parameter Name="Subject" Type="String" />
                    <asp:Parameter Name="Properties" Type="String" />
                    <asp:Parameter Name="Id" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="Id" />
                    <asp:Parameter Name="Body" Type="String" />
                    <asp:Parameter Name="ApptEnd" Type="DateTime"  />
                    <asp:Parameter Name="Location" Type="String" />
                    <asp:Parameter Name="Start" Type="DateTime" />
                    <asp:Parameter Name="Subject" Type="String"  />
                    <asp:Parameter Name="Properties" Type="String"  />
                </InsertParameters> 
            </asp:SqlDataSource>   
           
           
            <C1WebSchedule:C1WebSchedule ID="C1WebSchedule1" runat="server" Height="555px" ViewType="WorkWeekView"
                Width="637px">
                <DataStorage>
                    <AppointmentStorage DataSourceID="SqlDataSource1">
                        <Mappings>
                            <SubjectMapping MappingName="Subject" />
                            <LocationMapping MappingName="Location" />
                            <StartMapping MappingName="Start" />
                            <EndMapping MappingName="ApptEnd" />
                            <IdMapping MappingName="Id" />
                            <BodyMapping MappingName="Body" />
                        </Mappings>
                    </AppointmentStorage>
                </DataStorage>
            </C1WebSchedule:C1WebSchedule>


    Regards,
    Patrick
     
    All operations done through the data source.

    WebSchedule DataStorage bounds to the object that implements System.Web.UI.IDataSource(using DataSourceID). Through IDataSource.GetView  DataStorage  gets DataSourceView, and then it calls Update/Insert/Delete/Select methods of the DataSourceView.
    <Sehul Soni> wrote in message news:199198@10.0.1.98...

    Hi,

     Anyone can help me ?

    I take one WebSchedule in my Form and I want to just disply one Table Data on perticular Dates regarding that Table's date column.

    For that I set Appointment Sorege with DataSource.

    I set DisplyView is MonthView.

    I set All Edit Option Close.

    The Error is : "Data at the root level is invalid. Line 1, position 1."

    I set Id property as my Table's Primary Key Column "SeminarId" which is Autoincremented datatype.

     

    Waiting for reply.

     Thanks

    Sehul



    http://helpcentral.componentone.com/cs/forums/p/73377/199198.aspx#199198

  • 10-27-2007 7:29 AM In reply to

    Re: Getting Error "Data at the root level is invalid. Line 1, position 1."

    Hey Patrick,

    Thanks for replying.

    I add column in my table with uniqueidentifier datatype. and set the IDMapping with same new column. But still same problme is occurs.

    This is my Code

    ==================================================================

        <C1WebSchedule:C1WebSchedule ID="C1WebSchedule1" runat="server"
            ShowStatusBar="False" ViewType="MonthView">
            <CalendarInfo EndDateTime="19:00:00" StartDateTime="08:00:00" />
            <DataStorage>
                <AppointmentStorage DataMember="DefaultView" DataSourceID="SqlDataSource1">
                    <Mappings>
                        <SubjectMapping MappingName="SeminarName" />
                        <LocationMapping MappingName="State" />
                        <StartMapping MappingName="SeminarTime" />
                        <EndMapping MappingName="SeminarDate" />
                        <IdMapping MappingName="Col1" />
                        <BodyMapping MappingName="SeminarName" />
                        <AppointmentProperties MappingName="SeminarName" />
                    </Mappings>
                </AppointmentStorage>
            </DataStorage>
        </C1WebSchedule:C1WebSchedule>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SHC %>"
            SelectCommand="SELECT * FROM [SM]"></asp:SqlDataSource>

    ==================================================================
     here Column "Col1" is GUID.

     

    Regards,

    Sehul 

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.