c# - Why does compiling this code result in a syntax error? -


i wrote following code getting error mentioned can 1 tell

protected void btngenerate_click(object sender, eventargs e) {     datarow[] drow;     datatable dt = new datatable();     foreach (gridviewrow grrow in grdach.rows)     {         checkbox chkitem = (checkbox)grrow.findcontrol("checkrec");         if (chkitem.checked)         {             chkitm = true;             chkcnt++;             strbanktypeid = ((label)grrow.findcontrol("lblbanktype")).text.tostring();             strbnkarray.append(strbanktypeid);             strbnkarray.append(",");         }     }     oempdeposits.getempdepositdetails(out local_ds, strfedtaxid, payperiodnumber, payrollyear, strpayfreqtype);  (int = 0; < local_ds.tables[0].rows.count; i++)     {         string strtrim = strbnkarray.tostring().trimend(',');         strtrim = "bankaccounttypeid='" + strtrim[i] + "'";         if (strtrim.contains("bankaccounttypeid=',"))         {             strtrim = "bankaccounttypeid='" + strtrim[i] + "'";         }          drow = local_ds.tables[0].select(strtrim);     } } 

the syntax error comes statement:

drow = local_ds.tables[0].select(strbnkarray.tostring().trimend(',')); 

there wrong expression trying use.

that expression made this:

strbnkarray.tostring().trimend(',') 

check , find answer. perhaps:

string myselectstatement = strbnkarray.tostring().trimend(','); drow = local_ds.tables[0].select(myselectstatement); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -