Bonjour à tous,
voila,
j'ai fait une connexion via ASP.Net en reprenant le code de NCVF à l'adresse suivante:
http://aspfr.com/article.aspx?Val=497
donc j'ai ca dans la partie "All" de ASP.net:
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Oledb" %>
<script runat="server">
Sub Page_Load(sender As object,e As eventargs)
Dim DBobjConn As OleDBConnection
DBobjConn = New OleDBConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Request.MapPath("Password.mdb"))
DBobjConn.Open()
Dim ODDA_ModifTable As New OleDBCommand("SELECT * FROM Table",dbobjconn)
Dim malecture As OleDbDataReader
malecture=ODDA_ModifTable.ExecuteReader
Do until Not malecture.read
ListBox1.Items.Add(malecture("Login"))
Loop
malecture.Close
DBobjConn.Dispose
End Sub
Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs)
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:ListBox id="ListBox1" runat="server" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged" DataTextField="Nom" DataValueField="Nom"></asp:ListBox>
</form>
</body>
</html>
Quand je lance le projet j'ai ce message d'erreur:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Erreur de syntaxe dans la clause FROM.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Erreur de syntaxe dans la clause FROM.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[OleDbException (0x80040e14): Erreur de syntaxe dans la clause FROM.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +122
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +69
System.Data.OleDb.OleDbCommand.ExecuteReader() +7
ASP.index_aspx.Page_Load(Object sender, EventArgs e) +114
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Page.ProcessRequestMain() +731
Pouvez-vous m'aider?
je suis Débutant (de 2 jours) en ASP.net,
et je vois pas trop...
ya un truc à configurer?
Merci d'avance,
Florian.