hasib budi

hasib budi

  • NA
  • 20
  • 5k

update column in database

Sep 20 2020 10:19 PM
Hi, i have problem with update column in database. For right now i have a table name fileinfo, which contain csv file name,file size and number of row in csv. For first time the program run.It will save the csv file name and file size into fileinfo. The second time running. It will open csv file and save number of row in csv. The problem is if the fileinfo has two file. Both will have same value. for example, if csv file1 has 300row,csv file2 also will have 300row but in folder csv file2 only have 10 row. How can i do it ?
  1. int row = list.Count;  
  2. Console.WriteLine("Number of row " + row);  
  3.   
  4. var upd1 = "update fileinfo set row =@row;  
  5. var cmd5 = new NpgsqlCommand(upd1, conn);  
  6. cmd5.Parameters.AddWithValue("@row", Convert.ToDouble(row));

Answers (4)