Try
public void AddDropDownList(DropDownList obj,string[] arr)
{
for (int i = 0; i < arr.Length; i++)
{
obj.Items.Add(arr[i]);
}
}
you can use function this function to store values in given ways
string[] arr = { Names of States };
AddDropDownList(DropDownList1, arr);