I need to show every record which equals the var modid and the current session’s userid.
In .cs code this would be:
SELECT Mod_Naam
FROM Model
WHERE Mod_ID = " + modid + "
AND User_ID = '" + Session["status"].ToString() + "'
How can I import this query in a dropdownlist?
I may also need to use this on a gridview.
You can get the data from a DB via the
DataTableand then bind thatDataTableto the dropdownlist as follows:Take a look here, on how to get Data in DataTable Retrieve a DataTable using a SQL Statement