DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Page HTML Code

Sort:
You are not authorized to post a reply.





Growing Member





    I am in the process of trying to upgrade a very old 7.2.2 that I have inherited, and the business want to get more from.

    I have manahged to upgrade this to 7.4.1, but a couple of pages are not working, as they are having issues with SQL database connections

    One of the sets of code is doing a direct insert into a table, but no matter how i set this up, it just won't work,

     

    This is the code, it is pointing to a database that exists on the same server, and is in the webconfig as a database, any help would be great.

    Thanks.

     

     






    Veteran Member





      your code seems to be filtered





      Growing Member





        Sorry code not formatting correctly at the moment, let me work on this to get it all up.






        Growing Member





          <AddForm>

          <ScriptBlock BlockType="HeadScript" RegisterOnce="True" ScriptId="KBXM_Theme_none_test">

          <link rel="stylesheet" type="text/css" href="/DesktopModules/XModPro/styles/none" />

          ScriptBlock>

          <ScriptBlock BlockType="HeadScript" RegisterOnce="True" ScriptId="KBXM_Style_test">

          <style type="text/css">

          .xmp-test {

          padding: 10px 5px 5px 5px;

          }

          .xmp-test .xmp-form-row {

          margin: 3px;

          padding: 3px;

          clear:left;

          }

          .xmp-test label.xmp-form-label, .xmp-test span.xmp-form-label{

          display:block;

          float:left;

          width: 120px;

          text-align: left;

          margin-right: 5px;

          }

          .xmp-test .xmp-button {

          margin-right: 5px;

          }

          style>

          ScriptBlock>

          <SubmitCommand CommandText="INSERT INTO [cost_centre] ([cost_centre_coda], [cost_centre_ip], [cost_centre_name],@cost_centre_coda, @cost_centre_ip, @cost_centre_name, @notes, @division_id, @region_id, @cost_centre_status_id) " ConnectionString="Server={SERVERNAME};Database={database];UID={user};Pwd={Password}" />

          <ControlDataSource Id="cdsDivision" ConnectionString="[[ConnectionString:netcondb]]" CommandText="SELECT [division_id], [name] FROM [division] ORDER BY [sort_order] ASC">

          ControlDataSource>

          <ControlDataSource Id="cdsRegion" ConnectionString="[[ConnectionString:netcondb]]" CommandText="EXEC region_select">

          ControlDataSource>

          <ControlDataSource Id="cdsStatus" ConnectionString="[[ConnectionString:netcondb]]" CommandText="SELECT [cost_centre_status_id], [name] FROM [cost_centre_status] ORDER BY [sort_order] ASC">

          ControlDataSource>

          <div class="xmp-form xmp-test">

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="cost_centre_coda">

          Cost Centre Coda

          Label>

          <TextBox Id="cost_centre_coda" Width="35" Nullable="True" MaxLength="4" DataField="cost_centre_coda" DataType="string">

          TextBox>

          div>

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="cost_centre_ip">

          Cost Centre IP

          Label>

          <TextBox Id="cost_centre_ip" Width="35" Nullable="true" MaxLength="4" DataField="cost_centre_ip" DataType="string">

          TextBox>

          div>

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="cost_centre_name">

          Cost Centre Name

          Label>

          <TextBox Id="cost_centre_name" Width="200" Nullable="True" MaxLength="50" DataField="cost_centre_name" DataType="string">

          TextBox>

          div>

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="notes">

          Notes

          Label>

          <TextArea Id="notes" Height="80" Width="400" Nullable="true" DataField="notes" DataType="String">

          TextArea>

          div>

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="ddlDivision">

          Division

          Label>

          <DropDownList Id="ddlDivision" DataField="division_id" DataSourceId="cdsDivision" DataTextField="name" DataValueField="division_id" DataType="int32">

          DropDownList>

          div>

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="ddlRegion">

          Region

          Label>

          <DropDownList Id="ddlRegion" DataField="region_id" DataSourceId="cdsRegion" DataTextField="name" DataValueField="region_id" AppendDataBoundItems="true" DataType="int32">

          <ListItem Value="0">

          Please select ...

          ListItem>

          DropDownList>

          div>

          <div class="xmp-form-row">

          <Label CssClass="xmp-form-label" For="ddlStatus">

          Status

          Label>

          <DropDownList Id="ddlStatus" DataField="cost_centre_status_id" DataSourceId="cdsStatus" DataTextField="name" DataValueField="cost_centre_status_id" DataType="int32">

          DropDownList>

          div>

          <ValidationSummary CssClass="xmp-validation" Id="vscost_centre">

          ValidationSummary>

          <div class="xmp-form-row">

          <Label class="xmp-form-label">

          &nbsp;

          Label>

          <AddButton Text="Add">

          AddButton>

          <CancelButton Text="Cancel" style="margin-left: 12px;" Visible="true">

          CancelButton>

          div>

          div>

          AddForm>






          Veteran Member





            is this the code of the module or content of a module instance?
            How do you add it to the page?





            Growing Member





              Sorry, still trying to get my head around DNN.

              There is a form on a page that is reading from a database via this code, the error I am getting points to one of the elements being wrong in 7.4.1, but this is the only code that is built diffrently, all the others on other forms in the same page are based on exec a stored procedurem this is the ony one that uses an insert with variables, that I am assuming are being passed by the form from a drop down list.

              From the drop down, a user chooses an option, the forms pn the page are being populated by the results from what is chosen.






              Growing Member





                It's ok, I have found it, on another form there is a ref to an offline database, but as a direct connection string, this was throwing everything out.
                You are not authorized to post a reply.

                These Forums are dedicated to the discussion of DNN Platform.

                For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                5. No Flaming or Trolling.
                6. No Profanity, Racism, or Prejudice.
                7. Site Moderators have the final word on approving / removing a thread or post or comment.
                8. English language posting only, please.

                Would you like to help us?

                Awesome! Simply post in the forums using the link below and we'll get you started.

                Get Involved