Posted on: 5/23/2013 4:39:23 AM | Views : 217

HI,
Eventhough i am using controlparameters I am getting this error System.Data.SqlClient.SqlException: Must declare the scalar variable "@wem".
when i am using the following in page load Cartdet.SelectParameters.Add("wem",tb1.Text) page is working but no results
when i use this Cartdet.SelectParameters["wem"].DefaultValue = "5gtm.rajesh@gmail.com" getting this error Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Here is my code
<asp:sqldatasource id="Cartdet" selectcommand="SELECT id,cstype,CPrice FROM Cartlog where email = @wem" connectionstring="<%$ ConnectionStrings:AWLTConnectionString %>" runat="server"/> <selectparameters> <asp:controlparameter name="wem" controlid="tb1" propertyname="Te ...

Go to the complete details ...