I have an application that reads from a file and inserts the contents of the file into a table. I split the data up into substrings respective of their fields. For one of the fields, I need to replace a character (F
) with a 0
. I have tried this, however it isn't working (F
is still being 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();
for (int i = 0; i < 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();
}