Keresés

Hirdetés

Új hozzászólás Aktív témák

  • tothzsolt868

    újonc

    Üdv.
    Van 1 problémám. Nem nagyon értek c#-hoz és emiatt elakadtam 1 kisebb dolognál. Kinyitok 1 excel táblázatot amiből kikellene olvasnom a dátumot és összehasonlitanom az aktuális dátummal. Tudna ebben valaki segiteni?

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.OleDb;
    using System.Data.SqlClient;
    using Excel = Microsoft.Office.Interop.Excel;

    namespace MuszakiHatarido
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    //Tablazat megjelenitese
    OleDbConnection conn = new OleDbConnection();
    conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Raktaron.xlsx" + @";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;ImportMixedTypes=Text;TypeGuessRows=0""";

    OleDbCommand command = new OleDbCommand
    (
    "SELECT [Termek], [Darab], [Doboz], [Datum]" +
    "FROM [Alkatreszek$]", conn
    );
    DataSet dsDvds = new DataSet();
    OleDbDataAdapter adapter = new OleDbDataAdapter(command);
    adapter.Fill(dsDvds);

    dataGridViewDvd.DataSource = dsDvds.Tables[0];

    //Datum osszehasonlitas

    }

    private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {

    }

    private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
    {

    }
    }
    }

Új hozzászólás Aktív témák