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.
Sorry code not formatting correctly at the moment, let me work on this to get it all up.
<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"> Label> <AddButton Text="Add"> AddButton> <CancelButton Text="Cancel" style="margin-left: 12px;" Visible="true"> CancelButton> div> div> AddForm>
<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 {
style>
<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 Id="cdsStatus" ConnectionString="[[ConnectionString:netcondb]]" CommandText="SELECT [cost_centre_status_id], [name] FROM [cost_centre_status] ORDER BY [sort_order] ASC">
<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>
<Label CssClass="xmp-form-label" For="cost_centre_ip">
Cost Centre IP
<TextBox Id="cost_centre_ip" Width="35" Nullable="true" MaxLength="4" DataField="cost_centre_ip" DataType="string">
<Label CssClass="xmp-form-label" For="cost_centre_name">
Cost Centre Name
<TextBox Id="cost_centre_name" Width="200" Nullable="True" MaxLength="50" DataField="cost_centre_name" DataType="string">
<Label CssClass="xmp-form-label" For="notes">
Notes
<TextArea Id="notes" Height="80" Width="400" Nullable="true" DataField="notes" DataType="String">
TextArea>
<Label CssClass="xmp-form-label" For="ddlDivision">
Division
<DropDownList Id="ddlDivision" DataField="division_id" DataSourceId="cdsDivision" DataTextField="name" DataValueField="division_id" DataType="int32">
DropDownList>
<Label CssClass="xmp-form-label" For="ddlRegion">
Region
<DropDownList Id="ddlRegion" DataField="region_id" DataSourceId="cdsRegion" DataTextField="name" DataValueField="region_id" AppendDataBoundItems="true" DataType="int32">
<ListItem Value="0">
Please select ...
ListItem>
<Label CssClass="xmp-form-label" For="ddlStatus">
Status
<DropDownList Id="ddlStatus" DataField="cost_centre_status_id" DataSourceId="cdsStatus" DataTextField="name" DataValueField="cost_centre_status_id" DataType="int32">
<ValidationSummary CssClass="xmp-validation" Id="vscost_centre">
ValidationSummary>
<Label class="xmp-form-label">
<AddButton Text="Add">
AddButton>
<CancelButton Text="Cancel" style="margin-left: 12px;" Visible="true">
CancelButton>
AddForm>
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.
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:
Awesome! Simply post in the forums using the link below and we'll get you started.