does your select statement returns values if the busname is empty???
you set
busnamevar = "";
and you are not assigning any name for the variable.Assign some name and see whether it works or not
Edited: As the OP mentioned that he is passing value from another form
Check this to know how to pass values between the forms
passing values between two windows forms[
^]
Hope it helps
Update:
Instead of declaring the variable busnamevar as a string varibale,declare it as a property
and call the method Fillcombo once the value is set
private string _busnamevar = string.Empty;
public string Busnamevar
{
get
{
return _busnamevar;
}
set
{
_busnamevar = value;
FillCombo();
}
}
The query should be
string sql = "select cusname from new_customer where busname='"+Busnamevar+"'";