foreach (FileInfo file in filearr) { string name = file.Name; string s=file.Extension; string filepath = Path.GetFullPath(file.FullName); long filesize = file.Length; if (s == ".xls" && s == ".csv") { SqlCommand cmd1; cmd1 = new SqlCommand("[uspGetFilesinfo]", conn); cmd1.CommandType = CommandType.StoredProcedure; SqlParameter param11 = cmd1.Parameters.Add("@fileName", SqlDbType.NVarChar, 50); param11.Value = name; SqlParameter param12 = cmd1.Parameters.Add("@dirID", SqlDbType.Int); param12.Value = invid; SqlParameter param13 = cmd1.Parameters.Add("@dirName", SqlDbType.NVarChar, 50); param13.Value = txtinvname.Text; SqlParameter param14 = cmd1.Parameters.Add("@filesize", SqlDbType.Decimal, 15); param14.Value = filesize; SqlParameter param15 = cmd1.Parameters.Add("@filepath", SqlDbType.NVarChar); param15.Value = filepath; cmd1.ExecuteNonQuery(); } else { } }
//if (s == ".xls" && s == ".csv") if (s == ".xls" || s == ".csv")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)