This is a migrated thread and some comments may be shown as answers.

sqlDatasource updateCommand Parameters

3 Answers 223 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sanele
Top achievements
Rank 1
Sanele asked on 10 Nov 2011, 10:07 AM
From the example in this link: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx

Do the '?'s also apply for sqlDatasource updateCommand Parameters or only for sdsSessionDataSource parametersl? Im getting a ' use of undeclared scalar variable' error message if im passing the parameters prefixing them  with n '@' symbol. If i use ?, the error im getting is: Incorrect syntax near '?' 

Please advise

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Nov 2011, 10:52 AM
Hello Sanele,

Take a look into the following forum thread which discussed the same.
Incorrect syntax near '?'.

Thanks,
Princy.
0
Sanele
Top achievements
Rank 1
answered on 10 Nov 2011, 12:25 PM
Hi Princy

I appreciate your response. I do get the points from your example and from the research I'm doing. Could it be possible for you to post an example of a Hierarchical Grid with the requirements I specified?

Thank you in advance.
0
Sanele
Top achievements
Rank 1
answered on 14 Nov 2011, 12:02 PM
Hi

I have managed to solve the issues I mentioned before,and more which I stumbled across. I'm creating a hierarchical grid dynamically. I'm using one table to populate my grid which I imported from an excel doc.  Im able to do everything else, but there's only one problem. The third level of my grid is not being populated. Im getting a 'no fields to display' response.

I've tried to use the examples on the net to the best of my abilities yet. 

Please see code below..
_________________________________________________________________________________________________________
<MasterTableView DataSourceID="SessionDataSource1" DataKeyNames="CurriculumDetailsId" AllowMultiColumnSorting="True"  Width="100%" CommandItemDisplay="Top" Name="Strands">
            
              <DetailTables>
                    <telerik:GridTableView DataKeyNames="CurriculumDetailsParentId" DataSourceID="SessionDataSource2" Width="100%" runat="server" CommandItemDisplay="Top" Name="Topics">
                        <ParentTableRelation>                            
                            <telerik:GridRelationFields DetailKeyField="CurriculumDetailsParentId" MasterKeyField="CurriculumDetailsId" />
                        </ParentTableRelation>
                      <DetailTables>
                            <telerik:GridTableView DataKeyNames="CurriculumDetailsId" DataSourceID="SessionDataSource3" Width="100%" runat="server" CommandItemDisplay="Top" Name="Content">
                                    <ParentTableRelation>
                                        <telerik:GridRelationFields DetailKeyField="CurriculumDetailsParentId" MasterKeyField="CurriculumDetailsParentId" />
                                    </ParentTableRelation>
__________________________________________________________________________________________________________

<asp:SqlDataSource ID="SessionDataSource3" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" runat="server" ProviderName="System.Data.SqlClient" 
                           
                           SelectCommand="SELECT * FROM [CurriculumDetails] WHERE CurriculumDetailsTypeId = 3 AND CurriculumDetailsParentId = @CurriculumDetailsParentId"  OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues" >
            <SelectParameters> 
                <asp:SessionParameter Name="CurriculumDetailsParentId" SessionField="CurriculumDetailsParentId" Type="Int32" />           
            </SelectParameters>

___________________________________________________________________________________________________________
Please advise.
Tags
Grid
Asked by
Sanele
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Sanele
Top achievements
Rank 1
Share this question
or