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

Querystring Parameter not Working

5 Answers 103 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 19 Jun 2012, 02:48 PM
what am I doing wrong with the InsertParameters? personId give me null in database, other values work
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:SchoolConnectionString %>"
        DeleteCommand="DELETE FROM [Schedule] WHERE [Id] = @Id"
        InsertCommand="INSERT INTO [Schedule] ([start], [end], [personId], [descripton], [subject]) VALUES (@start, @end, @personId, @descripton, @subject)"
        SelectCommand="SELECT [start], [end], [personId], [descripton], [subject], [Id] FROM [Schedule]"
        UpdateCommand="UPDATE [Schedule] SET [start] = @start, [end] = @end, [personId] = @personId, [descripton] = @descripton, [subject] = @subject WHERE [Id] = @Id">
        <DeleteParameters>
            <asp:Parameter Name="Id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="start" Type="DateTime" />
            <asp:Parameter Name="end" Type="DateTime" />
            <asp:Parameter Name="personId" Type="Int32" />
             
            <asp:Parameter Name="descripton" Type="String" />
            <asp:Parameter Name="subject" Type="String" />
            <asp:Parameter Name="Id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="start" Type="DateTime" />
            <asp:Parameter Name="end" Type="DateTime" />
            <asp:QueryStringParameter Name="personId" Type="Int32" />
             
            <asp:Parameter Name="descripton" Type="String" />
            <asp:Parameter Name="subject" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    </form>

5 Answers, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 20 Jun 2012, 12:20 PM
Hello Rick,

Make sure that you do provide ID for every appointment inserted into the database, and it is unique.
Also, if you provide the unique key of the database table manually, you need to make sure that the table's unique key is not auto-incremented, in which way the unique key is generated automatically.

Greetings,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Rick
Top achievements
Rank 1
answered on 20 Jun 2012, 01:16 PM
There has to be a way to get the querystring value to the insert function for the radscheduler.

if I have a querystring with a userid = 27, how does it save to the database with the other fields such as start, end, subject? I know that it requires start, end, and subject...but how do you add another field not in the advanced template?

Example:

PatientList.aspx has a list of patients from grid. Click hyperlink that will direct it to Scheduler.aspx?userid = 27. The userid will be saved with the other values that are required for insert of schedular.

Can this work? or do I need to choose the patient from the dropdown in the advance template?
0
Peter
Telerik team
answered on 22 Jun 2012, 12:24 PM
Hi Rick,

You can either use Custom Attributes or define a resource type.

I hope this helps.

Greetings,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Rick
Top achievements
Rank 1
answered on 25 Jun 2012, 04:19 PM
thanks for the help.
I used the example at http://demos.telerik.com/aspnet-ajax/scheduler/examples/bindtolist/defaultcs.aspx
it allows me to program anything I need to the database with the appointment.
0
Peter
Telerik team
answered on 27 Jun 2012, 10:05 AM
Hello Rick, 

I am glad you were able to find a solution. 

Don't hesitate to contact us if you have other questions. 

Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Rick
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Rick
Top achievements
Rank 1
Peter
Telerik team
Share this question
or