Hi, I'm using Linq to bind a gridview and when I debug I get this exception:
"Input string was not in a correct format."
this function loads with the Form
is it because my DBis Still empty and can't get null cells?
if not can you tell me what the problem is?
"Input string was not in a correct format."
this function loads with the Form
Code:
private void DGVWCcode_Changed()
{
SalaryDClassesDataContext dc = new SalaryDClassesDataContext();
BindingSource bs = new BindingSource();
var wcmpnnts = from c in dc.Wage_Components
where c.EmployerID == int.Parse(tbEmplyrId.Text)
select new
{
ComponentCode = c.cmpnntCode,
ComponentDiscrition= c.cmnntDscrpt,
};
DGVWCcodes.DataMember = null;
bs.DataSource= wcmpnnts;/****here I get the exception***/
DGVWCcodes.DataSource = bs;
}
if not can you tell me what the problem is?