May I know how could I pass the value of driver from code behind and throw into the query in aspx file ?
Here is my aspx part:
<asp:SqlDataSource ID="cs_sc" runat="server"
ConnectionString="<%$ ConnectionStrings:MIMConnectionString %>"
SelectCommand="SELECT * FROM [Cash_Sales] WHERE [driver] = @driver">
<SelectParameters>
<asp:Parameter Name="driver" Direction="Input" Type="String" />
</SelectParameters></asp:SqlDataSource>
code behind:
protected void Button1_Click(object sender, EventArgs e)
{
driver = driverUpdateBox.SelectedItem.Text;
}
1 Answer