public string GenerateCsv(DataTable datatable, string fullpath) { string file = Path.GetFileName(fullpath); string ext = Path.GetExtension(fullpath); #region create try { if (!File.Exists(fullpath)) { File.Create(fullpath).Close(); } } catch (Exception ex) { string message = ex.Message.ToString(); } #endregion return fullpath; }