You can do it easily,
Code for binding database values to company drop down :
Getting values from data base, you will have those details in ViewState["Company"] and bind to your drop down as shown in below code.
ddlCompany.DataSource = ViewState["Company"];
ddlCompany.DataTextField = "description";
ddlCompany.DataValueField = "value";
ddlCompany.DataBind();
To build Departments :
You will have one input field for Departments dropdown in your stored procedure,
give it the input value as
cmnDetails.companyId = ddlCompany.SelectedValue;
In my code I used three tier architecture, hope you understand as I can't place all the code here. But if you need it I will post .
There is another way to solve is using Cascading dropdown concept.
Thank you