Problème connection base de données en C++

Problème connection base de données en C++ - C++ - Programmation

Marsh Posté le 14-09-2011 à 18:48:18    

Bonjour à tous,
 
je débute en C++ (je viens du C) et je voudrais connecter une base de données Access à une application développée avec visual C++. Pour ça j'ai utilisé un oleDbDataAdapter en suivant la méthode pas à pas de MSDN ici: http://msdn.microsoft.com/fr-fr/li [...] s.71).aspx
 
Mon problème arrive au moment de cliquer sur le bouton pour charger la bdd, j'obtiens les erreurs suivantes:
 
error C2653: 'dsArticle1' : n'est pas un nom de classe ni d'espace de noms
error C3861: 'Clear' : identificateur introuvable
error C2653: 'oleDbDataAdapter1' : n'est pas un nom de classe ni d'espace de noms
error C3861: 'Fill' : identificateur introuvable
 
Voici le code:
 

Code :
  1. #pragma once
  2. #include<iostream>
  3. namespace GOPharma {
  4. using namespace System;
  5. using namespace System::ComponentModel;
  6. using namespace System::Collections;
  7. using namespace System::Windows::Forms;
  8. using namespace System::Data;
  9. using namespace System::Drawing;
  10. /// <summary>
  11. /// Description rÈsumÈe de Form1
  12. ///
  13. /// AVERTISSEMENT†: si vous modifiez le nom de cette classe, vous devrez modifier la
  14. ///          propriÈtÈ 'Nom du fichier de ressources' de l'outil de compilation de ressource managÈe
  15. ///          pour tous les fichiers .resx dont dÈpend cette classe. Dans le cas contraire,
  16. ///          les concepteurs ne pourront pas interagir correctement avec les ressources
  17. ///          localisÈes associÈes ‡ ce formulaire.
  18. /// </summary>
  19. public ref class Form1 : public System::Windows::Forms::Form
  20. {
  21. public:
  22.  Form1(void)
  23.  {
  24.   InitializeComponent();
  25.   //
  26.   //TODO†: ajoutez ici le code du constructeur
  27.   //
  28.  }
  29. protected:
  30.  /// <summary>
  31.  /// Nettoyage des ressources utilisÈes.
  32.  /// </summary>
  33.  ~Form1()
  34.  {
  35.   if (components)
  36.   {
  37.    delete components;
  38.   }
  39.  }
  40. private: System::Data::OleDb::OleDbCommand^  oleDbSelectCommand1;
  41. protected:
  42. private: System::Data::OleDb::OleDbConnection^  oleDbConnection1;
  43. private: System::Data::OleDb::OleDbCommand^  oleDbInsertCommand1;
  44. private: System::Data::OleDb::OleDbCommand^  oleDbUpdateCommand1;
  45. private: System::Data::OleDb::OleDbCommand^  oleDbDeleteCommand1;
  46. private: System::Data::OleDb::OleDbDataAdapter^  oleDbDataAdapter1;
  47. private: GOPharma::DsArticle^  dsArticle1;
  48. private: System::Windows::Forms::DataGridView^  dataGridView1;
  49. private: System::Windows::Forms::DataGridViewTextBoxColumn^  rEFARTDataGridViewTextBoxColumn;
  50. private: System::Windows::Forms::DataGridViewTextBoxColumn^  dOSARTDataGridViewTextBoxColumn;
  51. private: System::Windows::Forms::DataGridViewTextBoxColumn^  nOMARTDataGridViewTextBoxColumn;
  52. private: System::Windows::Forms::DataGridViewTextBoxColumn^  pRESARTDataGridViewTextBoxColumn;
  53. private: System::Windows::Forms::DataGridViewTextBoxColumn^  pRIXARTDataGridViewTextBoxColumn;
  54. private: System::Windows::Forms::DataGridViewTextBoxColumn^  uNIARTDataGridViewTextBoxColumn;
  55. private: System::Windows::Forms::Button^  Btnload;
  56. private:
  57.  /// <summary>
  58.  /// Variable nÈcessaire au concepteur.
  59.  /// </summary>
  60.  System::ComponentModel::Container ^components;
  61. #pragma region Windows Form Designer generated code
  62.  /// <summary>
  63.  /// MÈthode requise pour la prise en charge du concepteur - ne modifiez pas
  64.  /// le contenu de cette mÈthode avec l'Èditeur de code.
  65.  /// </summary>
  66.  void InitializeComponent(void)
  67.  {
  68.   System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
  69.   this->oleDbSelectCommand1 = (gcnew System::Data::OleDb::OleDbCommand());
  70.   this->oleDbInsertCommand1 = (gcnew System::Data::OleDb::OleDbCommand());
  71.   this->oleDbUpdateCommand1 = (gcnew System::Data::OleDb::OleDbCommand());
  72.   this->oleDbDeleteCommand1 = (gcnew System::Data::OleDb::OleDbCommand());
  73.   this->oleDbDataAdapter1 = (gcnew System::Data::OleDb::OleDbDataAdapter());
  74.   this->oleDbConnection1 = (gcnew System::Data::OleDb::OleDbConnection());
  75.   this->dsArticle1 = (gcnew GOPharma::DsArticle());
  76.   this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView());
  77.   this->rEFARTDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
  78.   this->dOSARTDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
  79.   this->nOMARTDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
  80.   this->pRESARTDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
  81.   this->pRIXARTDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
  82.   this->uNIARTDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
  83.   this->Btnload = (gcnew System::Windows::Forms::Button());
  84.   (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dsArticle1))->BeginInit();
  85.   (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dataGridView1))->BeginInit();
  86.   this->SuspendLayout();
  87.   //  
  88.   // oleDbSelectCommand1
  89.   //  
  90.   this->oleDbSelectCommand1->CommandText = L"SELECT     ARTICLE.*\r\nFROM         ARTICLE";
  91.   this->oleDbSelectCommand1->Connection = this->oleDbConnection1;
  92.   //  
  93.   // oleDbInsertCommand1
  94.   //  
  95.   this->oleDbInsertCommand1->CommandText = L"INSERT INTO `ARTICLE` (`REFART`, `DOSART`, `NOMART`, `PRESART`, `PRIXART`, `UNIAR"
  96.    L"T`) VALUES (\?, \?, \?, \?, \?, \?)";
  97.   this->oleDbInsertCommand1->Connection = this->oleDbConnection1;
  98.   this->oleDbInsertCommand1->Parameters->AddRange(gcnew cli::array< System::Data::OleDb::OleDbParameter^  >(6) {(gcnew System::Data::OleDb::OleDbParameter(L"REFART",
  99.    System::Data::OleDb::OleDbType::Integer, 0, L"REFART" )), (gcnew System::Data::OleDb::OleDbParameter(L"DOSART", System::Data::OleDb::OleDbType::VarWChar,
  100.    0, L"DOSART" )), (gcnew System::Data::OleDb::OleDbParameter(L"NOMART", System::Data::OleDb::OleDbType::VarWChar, 0, L"NOMART" )),
  101.    (gcnew System::Data::OleDb::OleDbParameter(L"PRESART", System::Data::OleDb::OleDbType::VarWChar, 0, L"PRESART" )), (gcnew System::Data::OleDb::OleDbParameter(L"PRIXART",
  102.    System::Data::OleDb::OleDbType::Currency, 0, L"PRIXART" )), (gcnew System::Data::OleDb::OleDbParameter(L"UNIART", System::Data::OleDb::OleDbType::VarWChar,
  103.    0, L"UNIART" ))});
  104.   //  
  105.   // oleDbUpdateCommand1
  106.   //  
  107.   this->oleDbUpdateCommand1->CommandText = resources->GetString(L"oleDbUpdateCommand1.CommandText" );
  108.   this->oleDbUpdateCommand1->Connection = this->oleDbConnection1;
  109.   this->oleDbUpdateCommand1->Parameters->AddRange(gcnew cli::array< System::Data::OleDb::OleDbParameter^  >(17) {(gcnew System::Data::OleDb::OleDbParameter(L"REFART",
  110.    System::Data::OleDb::OleDbType::Integer, 0, L"REFART" )), (gcnew System::Data::OleDb::OleDbParameter(L"DOSART", System::Data::OleDb::OleDbType::VarWChar,
  111.    0, L"DOSART" )), (gcnew System::Data::OleDb::OleDbParameter(L"NOMART", System::Data::OleDb::OleDbType::VarWChar, 0, L"NOMART" )),
  112.    (gcnew System::Data::OleDb::OleDbParameter(L"PRESART", System::Data::OleDb::OleDbType::VarWChar, 0, L"PRESART" )), (gcnew System::Data::OleDb::OleDbParameter(L"PRIXART",
  113.    System::Data::OleDb::OleDbType::Currency, 0, L"PRIXART" )), (gcnew System::Data::OleDb::OleDbParameter(L"UNIART", System::Data::OleDb::OleDbType::VarWChar,
  114.    0, L"UNIART" )), (gcnew System::Data::OleDb::OleDbParameter(L"Original_REFART", System::Data::OleDb::OleDbType::Integer, 0,
  115.    System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"REFART", System::Data::DataRowVersion::Original,
  116.    nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_DOSART", System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input,
  117.    static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"DOSART", System::Data::DataRowVersion::Original, true, nullptr)),
  118.    (gcnew System::Data::OleDb::OleDbParameter(L"Original_DOSART", System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input,
  119.    false, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"DOSART", System::Data::DataRowVersion::Original, nullptr)),
  120.    (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_NOMART", System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input,
  121.    static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"NOMART", System::Data::DataRowVersion::Original, true, nullptr)),
  122.    (gcnew System::Data::OleDb::OleDbParameter(L"Original_NOMART", System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input,
  123.    false, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"NOMART", System::Data::DataRowVersion::Original, nullptr)),
  124.    (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_PRESART", System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input,
  125.    static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"PRESART", System::Data::DataRowVersion::Original, true, nullptr)),
  126.    (gcnew System::Data::OleDb::OleDbParameter(L"Original_PRESART", System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input,
  127.    false, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"PRESART", System::Data::DataRowVersion::Original, nullptr)),
  128.    (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_PRIXART", System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input,
  129.    static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"PRIXART", System::Data::DataRowVersion::Original, true, nullptr)),
  130.    (gcnew System::Data::OleDb::OleDbParameter(L"Original_PRIXART", System::Data::OleDb::OleDbType::Currency, 0, System::Data::ParameterDirection::Input,
  131.    false, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"PRIXART", System::Data::DataRowVersion::Original, nullptr)),
  132.    (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_UNIART", System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input,
  133.    static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"UNIART", System::Data::DataRowVersion::Original, true, nullptr)),
  134.    (gcnew System::Data::OleDb::OleDbParameter(L"Original_UNIART", System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input,
  135.    false, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"UNIART", System::Data::DataRowVersion::Original, nullptr))});
  136.   //  
  137.   // oleDbDeleteCommand1
  138.   //  
  139.   this->oleDbDeleteCommand1->CommandText = resources->GetString(L"oleDbDeleteCommand1.CommandText" );
  140.   this->oleDbDeleteCommand1->Connection = this->oleDbConnection1;
  141.   this->oleDbDeleteCommand1->Parameters->AddRange(gcnew cli::array< System::Data::OleDb::OleDbParameter^  >(11) {(gcnew System::Data::OleDb::OleDbParameter(L"Original_REFART",
  142.    System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0),
  143.    static_cast<System::Byte>(0), L"REFART", System::Data::DataRowVersion::Original, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_DOSART",
  144.    System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0),
  145.    L"DOSART", System::Data::DataRowVersion::Original, true, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"Original_DOSART",
  146.    System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0),
  147.    static_cast<System::Byte>(0), L"DOSART", System::Data::DataRowVersion::Original, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_NOMART",
  148.    System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0),
  149.    L"NOMART", System::Data::DataRowVersion::Original, true, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"Original_NOMART",
  150.    System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0),
  151.    static_cast<System::Byte>(0), L"NOMART", System::Data::DataRowVersion::Original, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_PRESART",
  152.    System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0),
  153.    L"PRESART", System::Data::DataRowVersion::Original, true, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"Original_PRESART",
  154.    System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0),
  155.    static_cast<System::Byte>(0), L"PRESART", System::Data::DataRowVersion::Original, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_PRIXART",
  156.    System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0),
  157.    L"PRIXART", System::Data::DataRowVersion::Original, true, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"Original_PRIXART",
  158.    System::Data::OleDb::OleDbType::Currency, 0, System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0),
  159.    static_cast<System::Byte>(0), L"PRIXART", System::Data::DataRowVersion::Original, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"IsNull_UNIART",
  160.    System::Data::OleDb::OleDbType::Integer, 0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0),
  161.    L"UNIART", System::Data::DataRowVersion::Original, true, nullptr)), (gcnew System::Data::OleDb::OleDbParameter(L"Original_UNIART",
  162.    System::Data::OleDb::OleDbType::VarWChar, 0, System::Data::ParameterDirection::Input, false, static_cast<System::Byte>(0),
  163.    static_cast<System::Byte>(0), L"UNIART", System::Data::DataRowVersion::Original, nullptr))});
  164.   //  
  165.   // oleDbDataAdapter1
  166.   //  
  167.   this->oleDbDataAdapter1->DeleteCommand = this->oleDbDeleteCommand1;
  168.   this->oleDbDataAdapter1->InsertCommand = this->oleDbInsertCommand1;
  169.   this->oleDbDataAdapter1->SelectCommand = this->oleDbSelectCommand1;
  170.   cli::array< System::Data::Common::DataColumnMapping^ >^ __mcTemp__1 = gcnew cli::array< System::Data::Common::DataColumnMapping^  >(6) {(gcnew System::Data::Common::DataColumnMapping(L"REFART",
  171.    L"REFART" )), (gcnew System::Data::Common::DataColumnMapping(L"DOSART", L"DOSART" )), (gcnew System::Data::Common::DataColumnMapping(L"NOMART",
  172.    L"NOMART" )), (gcnew System::Data::Common::DataColumnMapping(L"PRESART", L"PRESART" )), (gcnew System::Data::Common::DataColumnMapping(L"PRIXART",
  173.    L"PRIXART" )), (gcnew System::Data::Common::DataColumnMapping(L"UNIART", L"UNIART" ))};
  174.   this->oleDbDataAdapter1->TableMappings->AddRange(gcnew cli::array< System::Data::Common::DataTableMapping^  >(1) {(gcnew System::Data::Common::DataTableMapping(L"Table",
  175.    L"ARTICLE", __mcTemp__1))});
  176.   this->oleDbDataAdapter1->UpdateCommand = this->oleDbUpdateCommand1;
  177.   //  
  178.   // oleDbConnection1
  179.   //  
  180.   this->oleDbConnection1->ConnectionString = L"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\"C:\\Documents and Settings\\Christop"
  181.    L"he\\Mes documents\\Programmation\\C++\\GoPharma\\GOPharma.accdb\"";
  182.   //  
  183.   // dsArticle1
  184.   //  
  185.   this->dsArticle1->DataSetName = L"DsArticle";
  186.   this->dsArticle1->SchemaSerializationMode = System::Data::SchemaSerializationMode::IncludeSchema;
  187.   //  
  188.   // dataGridView1
  189.   //  
  190.   this->dataGridView1->AutoGenerateColumns = false;
  191.   this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
  192.   this->dataGridView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^  >(6) {this->rEFARTDataGridViewTextBoxColumn,
  193.    this->dOSARTDataGridViewTextBoxColumn, this->nOMARTDataGridViewTextBoxColumn, this->pRESARTDataGridViewTextBoxColumn, this->pRIXARTDataGridViewTextBoxColumn,
  194.    this->uNIARTDataGridViewTextBoxColumn});
  195.   this->dataGridView1->DataMember = L"ARTICLE";
  196.   this->dataGridView1->DataSource = this->dsArticle1;
  197.   this->dataGridView1->Location = System::Drawing::Point(1, 46);
  198.   this->dataGridView1->Name = L"dataGridView1";
  199.   this->dataGridView1->Size = System::Drawing::Size(526, 150);
  200.   this->dataGridView1->TabIndex = 0;
  201.   //  
  202.   // rEFARTDataGridViewTextBoxColumn
  203.   //  
  204.   this->rEFARTDataGridViewTextBoxColumn->DataPropertyName = L"REFART";
  205.   this->rEFARTDataGridViewTextBoxColumn->HeaderText = L"REFART";
  206.   this->rEFARTDataGridViewTextBoxColumn->Name = L"rEFARTDataGridViewTextBoxColumn";
  207.   //  
  208.   // dOSARTDataGridViewTextBoxColumn
  209.   //  
  210.   this->dOSARTDataGridViewTextBoxColumn->DataPropertyName = L"DOSART";
  211.   this->dOSARTDataGridViewTextBoxColumn->HeaderText = L"DOSART";
  212.   this->dOSARTDataGridViewTextBoxColumn->Name = L"dOSARTDataGridViewTextBoxColumn";
  213.   //  
  214.   // nOMARTDataGridViewTextBoxColumn
  215.   //  
  216.   this->nOMARTDataGridViewTextBoxColumn->DataPropertyName = L"NOMART";
  217.   this->nOMARTDataGridViewTextBoxColumn->HeaderText = L"NOMART";
  218.   this->nOMARTDataGridViewTextBoxColumn->Name = L"nOMARTDataGridViewTextBoxColumn";
  219.   //  
  220.   // pRESARTDataGridViewTextBoxColumn
  221.   //  
  222.   this->pRESARTDataGridViewTextBoxColumn->DataPropertyName = L"PRESART";
  223.   this->pRESARTDataGridViewTextBoxColumn->HeaderText = L"PRESART";
  224.   this->pRESARTDataGridViewTextBoxColumn->Name = L"pRESARTDataGridViewTextBoxColumn";
  225.   //  
  226.   // pRIXARTDataGridViewTextBoxColumn
  227.   //  
  228.   this->pRIXARTDataGridViewTextBoxColumn->DataPropertyName = L"PRIXART";
  229.   this->pRIXARTDataGridViewTextBoxColumn->HeaderText = L"PRIXART";
  230.   this->pRIXARTDataGridViewTextBoxColumn->Name = L"pRIXARTDataGridViewTextBoxColumn";
  231.   //  
  232.   // uNIARTDataGridViewTextBoxColumn
  233.   //  
  234.   this->uNIARTDataGridViewTextBoxColumn->DataPropertyName = L"UNIART";
  235.   this->uNIARTDataGridViewTextBoxColumn->HeaderText = L"UNIART";
  236.   this->uNIARTDataGridViewTextBoxColumn->Name = L"uNIARTDataGridViewTextBoxColumn";
  237.   //  
  238.   // Btnload
  239.   //  
  240.   this->Btnload->Location = System::Drawing::Point(142, 243);
  241.   this->Btnload->Name = L"Btnload";
  242.   this->Btnload->Size = System::Drawing::Size(75, 23);
  243.   this->Btnload->TabIndex = 1;
  244.   this->Btnload->Text = L"Charger";
  245.   this->Btnload->UseVisualStyleBackColor = true;
  246.   this->Btnload->Click += gcnew System::EventHandler(this, &Form1::Btnload_Click);
  247.   //  
  248.   // Form1
  249.   //  
  250.   this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  251.   this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  252.   this->ClientSize = System::Drawing::Size(525, 320);
  253.   this->Controls->Add(this->Btnload);
  254.   this->Controls->Add(this->dataGridView1);
  255.   this->Name = L"Form1";
  256.   this->Text = L"Form1";
  257.   (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dsArticle1))->EndInit();
  258.   (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dataGridView1))->EndInit();
  259.   this->ResumeLayout(false);
  260.  }
  261. #pragma endregion
  262. private: System::Void Btnload_Click(System::Object^  sender, System::EventArgs^  e)
  263.    {
  264.     dsArticle1::Clear();
  265.     oleDbDataAdapter1::Fill(dsArticle1);
  266.    }
  267. };
  268. }


 
Merci beaucoup d'avance pour votre aide avant que je me tape la tête contre les murs ;)

Reply

Marsh Posté le 14-09-2011 à 18:48:18   

Reply

Marsh Posté le 14-09-2011 à 22:18:20    

Citation :

dsArticle1::Clear();

:heink:  
Le message d'erreur est parfaitement justifié.
Et idem pour  

Citation :

oleDbDataAdapter1::Fill(dsArticle1);


C'est

Citation :

dsAuthors1->Clear();
 oleDbDataAdapter1->Fill(dsAuthors1);

qu'il devrait y avoir.
L'article du MSDN est erroné, l'article suivant a lui la syntaxe correcte.
A+,


Message édité par gilou le 14-09-2011 à 22:27:23

---------------
There's more than what can be linked! --    Iyashikei Anime Forever!    --  AngularJS c'est un framework d'engulé!  --
Reply

Marsh Posté le 14-09-2011 à 22:29:34    

Et bien oui je veux bien qu'il soit justifié mais pourquoi ??? Ce que j'ai mis là c'est bien ce qui est dans la procédure msdn alors je comprends pas


Message édité par jamsss le 14-09-2011 à 22:30:56
Reply

Marsh Posté le 14-09-2011 à 22:31:31    

Ah pardon j'ai répondu trop vite, merci de ta réponse ;)

Reply

Marsh Posté le 14-09-2011 à 22:39:08    

L'erreur sautait aux yeux à la lecture (on ne peut pas avoir un nom de variable devant le :: il faut un nom de classe ou de namespace). C'est pas parce que c'est imprimé sur une page web que c'est forcément juste.
A+,


---------------
There's more than what can be linked! --    Iyashikei Anime Forever!    --  AngularJS c'est un framework d'engulé!  --
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed