I have created a user control that takes a SQL string and creates a custom table. It works well with a static SQL string. (It seemed beyond the scope of datagrids, so bear with me.)
The problem is I would like the control to work more dynamically. I would like the SQL string to change depending on the customer's ID number. Here is what I have for the control:
cnt and strReq are public variables (Integer and String) built into the class I am using for my custom control. As you see here, I am passing a SQL string and it does work. However, I want the string to take a variable for the customer ID. I tried something like this:
and:
But both of those gave me errors. Any ideas?
The problem is I would like the control to work more dynamically. I would like the SQL string to change depending on the customer's ID number. Here is what I have for the control:
Code:
<USERCONTROL:testTable id="testTable1" runat="Server" cnt="2" strReq="SELECT * FROM Customers" />
cnt and strReq are public variables (Integer and String) built into the class I am using for my custom control. As you see here, I am passing a SQL string and it does work. However, I want the string to take a variable for the customer ID. I tried something like this:
Code:
<USERCONTROL:testTable id="testTable1" runat="Server" cnt="2" strReq="SELECT * FROM Customers WHERE ID LIKE '" & idVariable & "'" />
Code:
<USERCONTROL:testTable id="testTable1" runat="Server" cnt="2" strReq="SELECT * FROM Customers WHERE ID LIKE '<%= idVariable %>'" />
But both of those gave me errors. Any ideas?