1
私のコードを使用して、dataGridView(dgReceived)が "dateTimePicker1"(図のように)でフィルタリングされるように修正します。 ACCESSデータベースからデータを取得するのに効果的ですが、そのフィルタ機能を追加する必要があります。フィルタアクセスdatagridViewでdatetimepickerの値を塗りつぶします。C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace dataGridView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
OleDbConnection vcon = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;data source=C:\Query Form\Database.accdb");
vcon.Open();
DataSet ds = new DataSet();
OleDbDataAdapter daReceived = new OleDbDataAdapter();
OleDbCommand slctReceived = new OleDbCommand("SELECT * FROM script_Received", vcon);
daReceived.SelectCommand = slctReceived;
daReceived.Fill(ds, "tblReceived");
dgReceived.DataSource = ds.Tables["tblReceived"];
}
private void dgReceived_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
ここでコード内にバインドを挿入しますか?正しい場所に 「パブリッククラス」を挿入していますか? – Geo
私はあなたにドキュメント、RTFMへのリンクをくれました;) – Tergiver