if (!string.IsNullOrEmpty(path) && File.Exists(path)) { }
table_Entity result = new table_Entity(); var EntityQuery=from t in DB.Table1 where t.date >= d1 && t.date <= d2 select t;
foreach (string line in File.ReadAllLines("D:\\All Documents\\Famille.txt")) { }
public ViewModel() { string[] lineOfContents = File.ReadAllLines(ConfigurationManager.AppSettings["FiletextPath"]); MyList= new ObservableCollection<search>(); foreach (var line in lineOfContents) { string myline = line ; SearchCritaire = new search() { banc = line}; MyList.Add(SearchCritaire); } }
private RelayCommand Cmd; public RelayCommand cmd { get { return Cmd?? (extraction = new RelayCommand(param => Execute())); } } private void Execute () { MessageBox.Show("ok") ; }
<Inputs> <!--<Input>readOF</Input> --> <!--<Input>readOF</Input> --> <Input>readReference</Input> </Inputs>
<Input>readOF</Input> <Input>readOF</Input>
foreach (Excel.Shape sh in RapportXlSheet.Shapes) { sh.Delete(); }
RapportXlSheet.Shapes[imageName].Delete();
private void Print_Click(object sender, RoutedEventArgs e) { Excel.Application APP = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel.Workbook wb = APP.Workbooks.Open( my File path", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); // Get the first worksheet. // (Excel uses base 1 indexing, not base 0.) Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets[1]; ws.PrintOut( Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); }
try { if (xlWorkSheetCarteProd.Cells[i,1].Value==xlWorkSheetCarteProd.Cells[i + 1, 1].Value) { xlWorkSheetCarteProd.Cells[i +1, 1].Value = ""; }} catch{ }
if (xlWorkSheetCarteProd.Cells[i + 5, j].Value == xlWorkSheetCarteProd.Cells[i + 6, j].Value) { xlWorkSheetCarteProd.Cells[i + 6, j].Value = ""; }
private void button1_Click(object sender, EventArgs e) { String constring = ""; MySqlConnection connection = new MySqlConnection(constring); connection.Open(); BindingSource bs = new BindingSource(); bs.DataSource = dataGridView1.DataSource; bs.Filter = "SELECT * FROM (SELECT * FROM database.table ORDER BY (id) DESC LIMIT 5 WHERE Convert(researchKey,'System.String') like '" + textbox.Text + "') subq ORDER BY (id) ASC"; dataGridView1.DataSource = bs; }