Question : Question de mise à jour de données de C#

Salut veuillez trouver au-dessous de mon codage. Sa représentation n'importe quel Error.the du message final montrant également avec succès mis à jour mais de son pas updating.please voient mon accessPath ci-dessous du coding
string ; accessPath du
= Application.StartupPath + @ " \ abc.mdb " ; aConnection du
OleDbConnection = nouvel OleDbConnection (« Provider=Microsoft.Jet.OLEDB.4.0 ; Point d'émission = » + Application.StartupPath + @ » \ abc.mdb ; Gicleur OLEDB : Base de données Password=11111 ») ;
aConnection.Open () ; crUpdate du
OleDbCommand = aConnection.CreateCommand () ;
crUpdate.Parameters.Clear () ;
crUpdate.Parameters.Add (« @EmployeeNumber », OleDbType.VarChar). Valeur = txtNumber.Text ;
crUpdate.Parameters.Add (« @Title », OleDbType.VarChar). Valeur = cmbTitle.Text ;
crUpdate.Parameters.Add (FirstName "/>, OleDbType.VarChar). Valeur = txtFirstname.Text ; le


crUpdate.CommandText = des « employés de MISE À JOUR A PLACÉ Tittle=@Title, FirstName=@FirstName où EmployeeID=@EmployeeNumber » ; du
crUpdate.ExecuteNonQuery () ;
aConnection.Close () ;
MessageBox.Show (« Successfully mis à jour », « solutions ») ;

But si j'emploie le
crUpdate.CommandText = la « MISE À JOUR Tittle'Dr', RÉGLÉ par employés FirstName='test123'où EmployeeID=@EmployeeNumber » ;

is fonctionnant proeprly. Peut svp me montrer où l'iam faisant le mistake.thx
class= de

Réponse : Question de mise à jour de données de C#

Mon échantillon simple

Créer un compteur.
Dans qrband.beforeprint inc. le compteur
Dans le contrôle de qrband.afterprint le compteur, et si c'est en tant que force nécessaire une nouvelle page.

Voir l'exemple de code

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 :
56 :
57 :
58 :
59 :
60 :
61 :
62 :
63 :
64 :
65 :
66 :
67 :
68 :
69 :
70 :
71 :
72 :
73 :
74 :
75 :
76 :
77 :
78 :
79 :
80 :
81 :
82 :
83 :
84 :
85 :
86 :
87 :
88 :
89 :
90 :
91 :
92 :
93 :
94 :
95 :
96 :
97 :
98 :
99 :
100 :
101 :
102 :
103 :
104 :
105 :
106 :
107 :
108 :
109 :
110 :
111 :
112 :
113 :
114 :
115 :
116 :
117 :
118 :
119 :
120 :
121 :
122 :
123 :
124 :
125 :
126 :
127 :
128 :
129 :
130 :
131 :
132 :
133 :
134 :
135 :
136 :
137 :
138 :
139 :
140 :
141 :
142 :
143 :
144 :
145 :
146 :
147 :
148 :
149 :
150 :
151 :
152 :
153 :
154 :
155 :
156 :
157 :
158 :
159 :
160 :
161 :
162 :
163 :
164 :
165 :
166 :
167 :
168 :
169 :
170 :
171 :
172 :
173 :
174 :
175 :
176 :
177 :
178 :
179 :
180 :
181 :
182 :
183 :
184 :
185 :
186 :
187 :
188 :
189 :
190 :
191 :
192 :
193 :
194 :
195 :
196 :
197 :
198 :
199 :
200 :
201 :
202 :
203 :
204 :
205 :
206 :
207 :
208 :
209 :
210 :
211 :
212 :
213 :
214 :
215 :
216 :
217 :
218 :
219 :
220 :
221 :
222 :
223 :
224 :
225 :
226 :
227 :
228 :
229 :
230 :
231 :
232 :
233 :
234 :
235 :
236 :
237 :
238 :
239 :
240 :
241 :
242 :
243 :
244 :
245 :
246 :
247 :
248 :
249 :
250 :
unité Unit1 ;

interface

utilisations
  Windows, messages, SysUtils, variantes, classes, graphiques, commandes, formes,
  Dialogues, StdCtrls, QuickRpt, QRCtrls, ExtCtrls, DB, DBTables ;

type
  TForm1 = classe (TForm)
    Table1 : TTable ;
    QuickRep1 : TQuickRep ;
    QRBand2 : TQRBand ;
    QRDBText1 : TQRDBText ;
    QRDBText2 : TQRDBText ;
    QRDBText3 : TQRDBText ;
    Button1 : TButton ;
    procédé Button1Click (expéditeur : TObject) ;
    procédé QRBand2BeforePrint (expéditeur : TQRCustomBand ; variété PrintBand : Booléen) ;
    procédé QRBand2AfterPrint (expéditeur : TQRCustomBand ; BandPrinted : Booléen) ;
  privé
    {Déclarations privées}
  public
    {Déclarations publiques}
  extrémité ;

variété
  Form1 : TForm1 ;
  i : Nombre entier ;

exécution

{$R *.dfm}

procédé TForm1.Button1Click (expéditeur : TObject) ;
commencer
  i : = 0 ;
  QuickRep1.Preview ;
extrémité ;

procédé TForm1.QRBand2AfterPrint (expéditeur : TQRCustomBand ; BandPrinted : Booléen) ;
commencer
  si mod 5 = 0 d'I puis
    QuickRep1.NewPage ;
extrémité ;

procédé TForm1.QRBand2BeforePrint (expéditeur : TQRCustomBand ; variété PrintBand : Booléen) ;
commencer
  Inc. (i) ;
extrémité ;

extrémité.


la forme

objet Form1 : TForm1
  Gauche = 245
  Dessus = 92
  Légende = « Form1 »
  ClientHeight = 464
  ClientWidth = 854
  Couleur = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = « Tahoma »
  Font.Style = []
  OldCreateOrder = faux
  Mesuré = faux
  PixelsPerInch = 96
  TextHeight = 13
  objet QuickRep1 : TQuickRep
    Gauche = 76
    Dessus = 54
    Largeur = 794
    Taille = 1123
    Frame.Color = clBlack
    Frame.DrawTop = faux
    Frame.DrawBottom = faux
    Frame.DrawLeft = faux
    Frame.DrawRight = faux
    Ensemble de données = Table1
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = « Arial »
    Font.Style = []
    Functions.Strings = (
      « PAGENUMBER »
      « COLUMNNUMBER »
      « REPORTTITLE ")
    Functions.DATA = (
      « 0 »
      « 0 »
      #39#39)
    Options = [FirstPageHeader, LastPageFooter]
    Page.Columns = 1
    Page.Orientation = poPortrait
    Page.PaperSize = A4
    Page.Values = (
      100.000000000000000000
      2970.000000000000000000
      100.000000000000000000
      2100.000000000000000000
      100.000000000000000000
      100.000000000000000000
      0.000000000000000000)
    PrinterSettings.Copies = 1
    PrinterSettings.OutputBin = automobile
    PrinterSettings.Duplex = faux
    PrinterSettings.FirstPage = 0
    PrinterSettings.LastPage = 0
    PrinterSettings.UseStandardprinter = faux
    PrinterSettings.UseCustomBinCode = faux
    PrinterSettings.CustomBinCode = 0
    PrinterSettings.ExtendedDuplex = 0
    PrinterSettings.UseCustomPaperCode = faux
    PrinterSettings.CustomPaperCode = 0
    PrinterSettings.PrintMetaFile = faux
    PrinterSettings.PrintQuality = 0
    PrinterSettings.Collate = 0
    PrinterSettings.ColorOption = 0
    PrintIfEmpty = rectifient
    SnapToGrid = rectifient
    Unités = millimètre
    Bourdonnement = 100
    PrevFormStyle = fsNormal
    PreviewInitialState = wsNormal
    PrevInitialZoom = qrZoomToFit
    objet QRBand2 : TQRBand
      Gauche = 38
      Dessus = 38
      Largeur = 718
      Taille = 40
      Frame.Color = clBlack
      Frame.DrawTop = faux
      Frame.DrawBottom = faux
      Frame.DrawLeft = faux
      Frame.DrawRight = faux
      AfterPrint = QRBand2AfterPrint
      AlignToBottom = faux
      BeforePrint = QRBand2BeforePrint
      Couleur = clWhite
      TransparentBand = faux
      ForceNewColumn = faux
      ForceNewPage = faux
      Size.Values = (
        105.833333333333300000
        1899.708333333333000000)
      PreCaluculateBandHeight = faux
      KeepOnOnePage = faux
      À bande = rbDetail
      objet QRDBText1 : TQRDBText
        Gauche = 18
        Dessus = 12
        Largeur = 44
        Taille = 17
        Frame.Color = clBlack
        Frame.DrawTop = faux
        Frame.DrawBottom = faux
        Frame.DrawLeft = faux
        Frame.DrawRight = faux
        Size.Values = (
          44.979166666666670000
          47.625000000000000000
          31.750000000000000000
          116.416666666666700000)
        L'alignement = taLeftJustify
        AlignToBand = faux
        AutoSize = rectifient
        AutoStretch = faux
        Couleur = clWhite
        Ensemble de données = Table1
        DataField = « CustNo »
        Transparent = faux
        Le retour à la ligne automatique = rectifient
        FontSize = 10
      extrémité
      objet QRDBText2 : TQRDBText
        Gauche = 104
        Dessus = 12
        Largeur = 56
        Taille = 17
        Frame.Color = clBlack
        Frame.DrawTop = faux
        Frame.DrawBottom = faux
        Frame.DrawLeft = faux
        Frame.DrawRight = faux
        Size.Values = (
          44.979166666666670000
          275.166666666666700000
          31.750000000000000000
          148.166666666666700000)
        L'alignement = taLeftJustify
        AlignToBand = faux
        AutoSize = rectifient
        AutoStretch = faux
        Couleur = clWhite
        Ensemble de données = Table1
        DataField = « compagnie »
        Transparent = faux
        Le retour à la ligne automatique = rectifient
        FontSize = 10
      extrémité
      objet QRDBText3 : TQRDBText
        Gauche = 454
        Dessus = 11
        Largeur = 24
        Taille = 17
        Frame.Color = clBlack
        Frame.DrawTop = faux
        Frame.DrawBottom = faux
        Frame.DrawLeft = faux
        Frame.DrawRight = faux
        Size.Values = (
          44.979166666666670000
          1201.208333333333000000
          29.104166666666670000
          63.500000000000000000)
        L'alignement = taLeftJustify
        AlignToBand = faux
        AutoSize = rectifient
        AutoStretch = faux
        Couleur = clWhite
        Ensemble de données = Table1
        DataField = « ville »
        Transparent = faux
        Le retour à la ligne automatique = rectifient
        FontSize = 10
      extrémité
    extrémité
  extrémité
  objet Button1 : TButton
    Gauche = 10
    Dessus = 12
    Largeur = 75
    Taille = 25
    Légende = « Button1 »
    TabOrder = 1
    OnClick = Button1Click
  extrémité
  objet Table1 : TTable
    L'Active = rectifient
    DatabaseName = « DBDEMOS »
    TableName = « customer.db »
    Gauche = 228
    Dessus = 120
  extrémité
extrémité
Autres solutions  
  •  MS Excel 2007 et pdf - l'exportation vers le pdf prend de longues heures !
  •  Dans le Perl, comment j'ajoute une valeur à la liste, puis le contrôle pour voir si la valeur existent avant d'ajouter une nouvelle valeur
  •  Comment fais j'initialiser de la HP BL460c G6 de san et de la HP XP 240000
  •  Comment fais j'employer une clef de permis de volume sur un ordinateur de HP avec du CD de restauration
  •  Emplacement primaire de deux SCCM dans l'annuaire actif
  •  L'initiateur et la HP D2D de l'iSCSI R2 du serveur 2008 de Windows GERCENT l'issue
  •  Stocker le dossier dans le mysql using connector.net et le champ de goutte
  •  Carte vidéo d'USB - bit 32 sur le matériel travaillant au niveau du bit 64 ?
  •  asp.net que j'essaye de convertir une forme de HTML en forme d'aspx ou ? ce qui jamais. Aide du besoin sur la façon dont à à elle.
  •  Winzip 12 issues de secours du travail ?
  •  
    programming4us programming4us