Определение параметров в SQLDatasource в devexpress - PullRequest
0 голосов
/ 20 ноября 2018

У меня есть SQLDataSource, в котором есть оператор вставки и определены параметры, см. Фото ниже:

enter image description here

Когда я запускаю свою программу, она будетвсегда утверждает, что не может найти элемент управления txtlName.Что не так с моей реализацией?Может кто-нибудь сказать, как это исправить?

Это мой код разметки для моего sqldatasource.

<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:MDRFConnectionString %>" InsertCommand="INSERT INTO MDRF_Main(MDRF_LName, MDRF_FName, MDRF_MName, MDRF_Department, MDRF_RequestType, MDRF_Status, MDRF_WorkflowId, MDRF_Company, MDRF_Remarks, MDRF_RequestModule, MDRF_DateRequired, MDRF_Priority, MDRF_ResponseTime, MDRF_Module, MDRF_DocNum) VALUES (@lname, @fname, @mname, @dept, @rt, @status, @work, @comp, @remarks, @rm, CONVERT(datetime, @date) , @prio, @response, @module, @dn)" OnSelecting="SqlDataSource4_Selecting" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [MDRF_Main]">
                 <InsertParameters>
                     <asp:ControlParameter ControlID="txtLname" Name="lname" PropertyName="Text" />
                     <asp:ControlParameter ControlID="txtFname" Name="fname" PropertyName="Text" />
                     <asp:ControlParameter ControlID="txtMname" Name="mname" PropertyName="Text" />
                     <asp:ControlParameter ControlID="cmbDepartment" Name="dept" PropertyName="Value" />
                     <asp:ControlParameter ControlID="cmbRequestType" Name="rt" PropertyName="Value" />
                     <asp:ControlParameter ControlID="cmbStatus" Name="status" PropertyName="Value" />
                     <asp:ControlParameter ControlID="cmbWorkflow" Name="work" PropertyName="Value" />
                     <asp:ControlParameter ControlID="cmbCompany" Name="comp" PropertyName="Value" />
                     <asp:ControlParameter ControlID="txtRemarks" Name="remarks" PropertyName="Text" />
                     <asp:ControlParameter ControlID="cmbMasterData" Name="rm" PropertyName="Value" />
                     <asp:ControlParameter ControlID="txtDate" Name="date" PropertyName="Date" DbType="DateTime" />
                     <asp:ControlParameter ControlID="cmbPriority" Name="prio" PropertyName="Value" />
                     <asp:ControlParameter ControlID="txtResponse" Name="response" PropertyName="Text" />
                     <asp:Parameter DefaultValue="''" Name="module" />
                     <asp:ControlParameter ControlID="txtDocNum" DefaultValue="" Name="dn" PropertyName="Text" />
                 </InsertParameters>
             </asp:SqlDataSource>  

Спасибо

...