在devexpress中的SQLDatasource中定义参数

时间:2018-11-20 13:10:41

标签: devexpress sqldatasource

我有一个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>  

谢谢

0 个答案:

没有答案