c# - String Replace For Insert -
c# - String Replace For Insert -
this question has reply here:
string.replace (or other string modification) not working 4 answersi have application reads file , inserts contents of file table. split info substrings respective of fields. 1 of fields, need replace character (f
) 0
. have tried this, isn't working (f
still beingness inserted).
string[] mylines02 = system.io.file.readalllines(@"c:\\billingexport\\imports\\acntbill.all.type02.frmated.txt"); list<account_bill_plans> table2_1input = new list<account_bill_plans>(); account_bill_plans table2_1 = new account_bill_plans(); (int = 0; < mylines02.length; i++) { var fixf_over = mylines02[i].substring(64, 3).trim().tostring(); if (fixf_over.contains("f")) { fixf_over.replace("f", "0"); } table2_1input.add(table2_1); using (sqlcommand cmd72 = new sqlcommand(insertstring72, _cond2)) { cmd72.parameters.add("@overpayment_limit", sqldbtype.nchar); cmd72.parameters["@overpayment_limit"].value = fixf_over; cmd72.executenonquery(); _cond2.close(); }
apply variable?
fixf_over = fixf_over.replace("f", "0");
c# sql
Comments
Post a Comment