Salut,
je veux créer un état reportviewer dans mon application c# avec comme paramètre pour ma requête sql la référence provenant de mon champs combobox.
j'ai suivi un tuto sur youtube qui ma permit d'avoir le code ci-dessous.
Je rencontre l'erreur ci-dessous :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 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; using System.Data.Odbc; using System.Globalization; using System.Diagnostics; using System.IO; using MySql.Data; using MySql.Data.MySqlClient; using MySql.Data.Entity; namespace IMPORTATION { public partial class ETAT_JOURNALIER : Form { ClassGle cls = new ClassGle(); public ETAT_JOURNALIER() { InitializeComponent(); } private void remplircombo() { OdbcConnection maconnexion = cls.ouvrirConnection(ClassGle.chaine); string requete = "select distinct reference from tableau_bord"; OdbcDataReader lire = cls.ouvrirRequète(requete, maconnexion); while (lire.Read()) { comboBox1.Items.Add(lire["reference"]); } } private void ETAT_JOURNALIER_Load(object sender, EventArgs e) { // TODO: cette ligne de code charge les données dans la table 'DataSet1.DataTable'. Vous pouvez la déplacer ou la supprimer selon vos besoins. remplircombo(); } private void button2_Click(object sender, EventArgs e) { this.DataTableTableAdapter.Fill(this.DataSet1.DataTable, comboBox1.Text); this.reportViewer1.RefreshReport(); this.reportViewer1.RefreshReport(); } } }
Merci de votre aide.Aucune surcharge pour la méthode 'Fill' ne prend d'arguments 2
Partager