Link to home
Start Free TrialLog in
Avatar of gdspeare
gdspeare

asked on

SQL DataAdapter with parameter

I have a sqldatasource that needs a parameter passed to it.

the attached is not working.  

ideas?

thanks
Session["PID"] = lbx_PIDs.SelectedValue.ToString();

SqlDataAdapter da = new SqlDataAdapter(sds_DataForPID.SelectParameters.Add("@PID", TypeCode.Char, Session["PID"].ToString()), sds_DataForPID);

Open in new window

Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Do you have the parameter already defined in the front end?

sds_DataForPID.SelectParameters["PID"].DefaultValue = lbx_PIDs.SelectedValue.ToString();

ASKER CERTIFIED SOLUTION
Avatar of Temizh
Temizh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial