Salut,

je suis dans un page (normalement) écrite en C#. Si c'est pas le cas vous pouvez me le dire...

j'ai essayé de rajouter une requete sur mysql en suivant le tuto http://dotnet.developpez.com/faq/asp...=ado_connexion mais j'ai l'erreur suivante. Je vois pas trop quelle parenthèse il pourrait manquer...

Compiler Error Message: CS1003: Syntax error, '(' expected
Source Error:
Line 120:String CRPpassword = "";
Line 121:
Line 122:using System;
Line 123://using ...
Line 124:using System.Data;
Source File: c:\inetpub\wwwroot\Citrix\MetaFrame\auth\include\loginMainForm.inc Line: 122
est ce que j'oublie un truc ???

et voici le code de la page complète au cas ou...

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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
<%
// loginMainForm.inc
// Copyright (c) 2000 - 2005 Citrix Systems, Inc. All Rights Reserved.
// Web Interface (Build 45083)
%>
<tr>
  <td>
    <table border='0' cellspacing='3' cellpadding='0'>
      <tr>
        <td>
          <table border="0" cellspacing='0' cellpadding='3'>
<%
if (viewControl.getShowLoginTypeOptions()) {
%>
            <tr>
              <td>
                <table border="0" cellspacing="0" cellpadding="2">
                  <tr align='left' valign='top'>
                    <td nowrap>
                      <label id='lblLoginType' class='xsNorm' for='<%=ID_LOGIN_TYPE%>'
                          title="<%=getString("TipLoginType", currentLocale)%>"
                      <%=viewControl.getAllUIDisabledStr()%>>
                      <%=getString("LoginType", currentLocale)%>
                      </label>
                    </td>
                 </tr>
                 <tr>
                   <td colspan='2' valign='top'>
                     <select name='<%=ID_LOGIN_TYPE%>' id='<%=ID_LOGIN_TYPE%>' <%=viewControl.getAllUIDisabledStr()%>
                          class='loginEntries' size='1' onchange='onChangeLoginType(this.form)'>
<%
    if( viewControl.allowedLogonModes().contains( AuthMethod.ANONYMOUS ) ) {
%>
                       <option value='<%=AuthMethod.ANONYMOUS%>' <%=viewControl.getAnonymousSelectedStr()%>>
                         <%=getString("AnonymousUser", currentLocale)%>
                       </option>
<%
    }
%>
<%
    if( viewControl.allowedLogonModes().contains( AuthMethod.CERTIFICATE_SINGLE_SIGN_ON ) ) {
%>
                       <option value='<%=AuthMethod.CERTIFICATE_SINGLE_SIGN_ON%>'  <%=viewControl.getCertificateSSONSelectedStr()%>>
                         <%=getString("CertificateSSONUser", currentLocale)%>
                       </option>
<%
    }
%>
<%
    if( viewControl.allowedLogonModes().contains( AuthMethod.CERTIFICATE ) ) {
%>
                       <option value='<%=AuthMethod.CERTIFICATE%>' <%=viewControl.getCertificateSelectedStr()%>>
                         <%=getString("CertificateUser", currentLocale)%>
                       </option>
<%
    }
%>
<%
    if( viewControl.allowedLogonModes().contains( AuthMethod.SINGLE_SIGN_ON ) ) {
%>
                       <option value='<%=AuthMethod.SINGLE_SIGN_ON%>' <%=viewControl.getSSONSelectedStr()%>>
                         <%=getString("SingleSignOnUser", currentLocale)%>
                       </option>
<%
    }
%>
<%
    if( viewControl.allowedLogonModes().contains( AuthMethod.EXPLICIT ) ) {
%>
                       <option value='<%=AuthMethod.EXPLICIT%>' <%=viewControl.getExplicitSelectedStr()%>>
                         <%=getString("ExplicitUser", currentLocale)%>
                       </option>
<%
    }
%>
                      </select>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
<%
} else {
%>
            <input type='hidden' name='<%=ID_LOGIN_TYPE%>' value='<%=AuthMethod.EXPLICIT%>'>
<%
}
%>
            <tr>
              <td colspan='3'>
<%
if (viewControl.getShowLoginTypeOptions()) {
%>
                <fieldset>
                <legend>
                <label id='lblCredentials' class='xsNorm' <%=viewControl.getExplicitDisabledStr()%>>
                <%=getString("EnterLoginCredentials", currentLocale)%>
                </label>
                </legend>
<%
}
%>
                <table border='0' cellspacing='0' cellpadding='1'>
                  <tr>
                    <td>
                      <table border="0" cellspacing="0" cellpadding="2">
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblUserName' class='xsNorm' for='<%=ID_USER%>'
                                title="<%=getString("TipUserName", currentLocale)%>" 
                            <%=viewControl.getExplicitDisabledStr()%>>
                            <%=getString("UserName", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
<%
String CRPuser = "";
String CRPpassword = "";
 
using System;
//using ... 
using System.Data; 
using System.Data.Odbc; 
 
//Chaine de connexion pour MyODBC 3.51 
string MyConstring="DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=crpbioweb;" + "DATABASE=testSSOcitrix;" + "UID=root;" + "PASSWORD=;"; 
 
OdbcConnection con = new OdbcConnection(MyConstring); 
 
try 
{ 
   con.Open(); 
   OdbcCommand MyCommand = new OdbcCommand(); 
   MyCommand.Connection = con; 
 
   MyCommand.CommandText = "SELECT password FROM user"; 
   OdbcDataReader MyDataReader; 
   MyDataReader = MyCommand.ExecuteReader(); 
 
   while (MyDataReader.Read()) 
     { 
        Response.Write("Data:" + MyDataReader.Getstring(1));
     } 
   con.Close(); 
   } 
catch (Exception ex) 
{ 
    Response.Write("<body><script>alert(\" "+  ex.Message + "\");</script></body>");
}
 
%>
 
                            <input type='text' name='<%=ID_USER%>' id='<%=ID_USER%>'
                                class='loginEntries'
								value='<%=CRPuser%>'
                                maxlength='<%=LOGIN_ENTRY_MAX_LENGTH%>' <%=viewControl.getExplicitDisabledStr()%>
<%
if (viewControl.getUserName() != null) {
%>
                                value='<%=Utilities.htmlEncode(viewControl.getUserName())%>'
<%
}
%>
                                onkeyup='onUsernameTextEntry(this.form)'
                                onChange='onUsernameTextEntry(this.form)'
                            >
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <table border="0" cellspacing="0" cellpadding="2">
<%
if (viewControl.getShowPassword()) {
%>
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblPasswd' class='xsNorm' for='<%=ID_PASSWORD%>'
                                title="<%=getString("TipPassword", currentLocale)%>"
                            <%=viewControl.getExplicitDisabledStr()%>>
                            <%=getString("Password", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
                            <input type='password' name='<%=ID_PASSWORD%>' id='<%=ID_PASSWORD%>' value='<%=CRPpassword%>'
                                class='loginEntries'
                                maxlength='<%=LOGIN_ENTRY_MAX_LENGTH%>' <%=viewControl.getExplicitDisabledStr()%>>
                          </td>
                        </tr>
<%
} else if (viewControl.getShowPasscode()) { //if passcode is visible, but password is not, then replace the password field with the passcode field
%>
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblPasscode' for='<%=ID_PASSCODE%>' class='xsNorm'
                                title="<%=getString("TipPasscode", currentLocale)%>"
                            <%=viewControl.getExplicitDisabledStr()%>>
                            <%=getString("Passcode", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
                            <input type='password' name='<%=ID_PASSCODE%>' id='<%=ID_PASSCODE%>'
                                class='loginEntries' maxlength='<%=LOGIN_ENTRY_MAX_LENGTH%>' <%=viewControl.getExplicitDisabledStr()%>>
                          </td>
                       </tr>
<%
}
%>
                      </table>
                    </td>
                  </tr>
<%
if (viewControl.getShowDomain()) {
%>
                  <tr>
                    <td>
                      <table border="0" cellspacing="0" cellpadding="2">
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblDomain' class='xsNorm' for='<%=ID_DOMAIN%>'
                                title="<%=getString("TipDomain", currentLocale)%>"
                            <%=viewControl.getDomainDisabledStr()%>>
                            <%=getString("Domain", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
<%
    if (viewControl.getRestrictDomains() || viewControl.getNumLoginDomains() > 0) {
%>
                            <select class='loginEntries' size='1'
                                  name='<%=ID_DOMAIN%>' id='<%=ID_DOMAIN%>'
                              <%=viewControl.getDomainDisabledStr()%>>
<%
        for (int i=0; i < viewControl.getNumLoginDomains(); i++) {
%>
                              <option value='<%=Utilities.htmlEncode(viewControl.getLoginDomains()[i])%>'>
                                <%=Utilities.htmlEncode(viewControl.getLoginDomains()[i])%>
                              </option>
<%
        }
%>
                            </select>
<%
    } else {
%>
                            <input type='text' class='loginEntries'
                                name='<%=ID_DOMAIN%>' id='<%=ID_DOMAIN%>'
                                MAXLENGTH='<%=LOGIN_ENTRY_MAX_LENGTH%>'
                            <%=viewControl.getDomainDisabledStr()%>>
<%
    }
%>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
<%
}
 
if (viewControl.getNDSEnabled()) {
    if (viewControl.getNumNDSContexts() > 0 || viewControl.getShowFindContext()) {
%>
                  <tr>
                    <td>
                      <table border="0" cellspacing="0" cellpadding="2">
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblContext' class='xsNorm'
                                for='<%=ID_CONTEXT%>'
                                title="<%=getString("TipContext", currentLocale)%>">
                            <%=getString("Context", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
                            <select name='<%=ID_CONTEXT%>' id='<%=ID_CONTEXT%>'
                                  size='1' class='loginEntries'>
<%
        // Find context is always at the top of the list if it is present
        // Only selected if there are no found contexts being shown
        if (viewControl.getShowFindContext()) {
%>
                              <option <%=(viewControl.getNumNDSContexts() > 0) ? "" : "selected"%>>
                                <%=getString("lookupContextString", currentLocale)%>
                              </option>
<%
        }
        if (viewControl.getNumNDSContexts() > 0) {
            for (int j=0; j < viewControl.getNumNDSContexts(); j++) {
%>
                              <option <%=(j == 0) ? "selected" : ""%>
                                    value='<%=Utilities.htmlEncode(viewControl.getNDSContexts()[j])%>'>
                                <%=Utilities.htmlEncode(viewControl.getNDSContexts()[j])%>
                              </option>
<%
            }
        }
%>
                            </select>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
<%
    }
%>
                  <tr>
                    <td>
                      <table border="0" cellspacing="0" cellpadding="2">
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblTree' class='xsNorm' for='<%=ID_TREE%>'
                                title="<%=getString("TipTree", currentLocale)%>">
                            <%=getString("Tree", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
                            <input type='text' readonly name='<%=ID_TREE%>' id='<%=ID_TREE%>'
                                class='loginTreeEntry' value='<%=Utilities.htmlEncode(viewControl.getNDSTree())%>'>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
<%
}
 
if (viewControl.getShowPasscode() && viewControl.getShowPassword() ) { //only display the passcode field here if the password field is displayed above
%>
                  <tr>
                    <td>
                      <table border="0" cellspacing="0" cellpadding="3">
                        <tr>
                          <td align='left' valign='top' nowrap>
                            <label id='lblPasscode' for='<%=ID_PASSCODE%>' class='xsNorm'
                                title="<%=getString("TipPasscode", currentLocale)%>"
                            <%=viewControl.getExplicitDisabledStr()%>>
                            <%=getString("Passcode", currentLocale)%>
                            </label>
                          </td>
                        </tr>
                        <tr>
                          <td valign='top'>
                            <input type='password' name='<%=ID_PASSCODE%>' id='<%=ID_PASSCODE%>'
                                class='loginEntries' maxlength='<%=LOGIN_ENTRY_MAX_LENGTH%>' <%=viewControl.getExplicitDisabledStr()%>>
                          </td>
                       </tr>
                      </table>
                    </td>
                  </tr>
<%
}
%>
                </table>
<%
if (viewControl.getShowLoginTypeOptions()) {
%>
                </fieldset>
<%
}
%>
              </td>
            </tr>
            <tr name="<%=ID_OPENLINK_ADV_OPTIONS%>" id="<%=ID_OPENLINK_ADV_OPTIONS%>" <%=viewControl.getAdvancedOptionsOpenLinkDisplayStr()%>>
              <td align="right"><a href="#<%=ID_ADV_OPTIONS_ANCHOR%>" class="appLinksSmall" onClick="openAdvOptions(this.form)"><%=getString("AdvancedOptionsOpen", currentLocale)%></a></td>
            </tr>
<%
if (! viewControl.getShowAdvancedOptionsPermanently()) {
%>
            <tr name="<%=ID_CLOSELINK_ADV_OPTIONS%>" id="<%=ID_CLOSELINK_ADV_OPTIONS%>" <%=viewControl.getAdvancedOptionsCloseLinkDisplayStr()%>>
              <td align="right"><a href="#" class="appLinksSmall" onClick="closeAdvOptions(this.form)"><%=getString("AdvancedOptionsClose", currentLocale)%></a></td>
            </tr>
<%
}
%>
          </table>
        </td>
      </tr>
    </table>
  </td>
</tr>

merci