הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 12-07-06, 16:00   # 1
בניה
משתמש - היכל התהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: נחושה
הודעות: 3,434

בניה לא מחובר  

בעיות בקוד ASP.net

ב"ה


יש לי את הקוד דוגמא הזה:
קוד:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.ADO" %>
<html>
<script language="VB" runat="server">
    sub Page_Load(obj as Object, e as EventArgs) 

        'set up connection
        dim myConnection as ADOConnection = new ADOConnection _
                     ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                      "Data Source=D:\Bnaya\59347\banking.mdb")

        'open connection
        dim myCommand as ADODataSetCommand = new ADODataSetCommand _
                             ("SELECT * FROM tblUsers", myConnection)

        'fill dataset
        dim ds as DataSet = new DataSet()
        myCommand.FillDataSet(ds, "tblUsers")

        'select data view and bind to server control
        MyDataList.DataSource = ds.Tables("tblUsers"). _
								DefaultView
        MyDataList.DataBind()
    end sub
</script>

<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">

  <asp:DataList id="MyDataList" RepeatColumns="2" RepeatDirection= 
                                        "Vertical" runat="server">
      <%# DataBinder.Eval(Container.DataItem, "FirstName") %>&nbsp; 
            <%# DataBinder.Eval(Container.DataItem, "LastName") %>
            </i></b>
          </div>
          <br />

          <b>Address: </b><%# DataBinder.Eval(Container.DataItem, _
                                               "Address") %><br />
          <b>City: </b><%# DataBinder.Eval(Container.DataItem, _
                                                    "City") %><br />
          <b>State: </b><%# DataBinder.Eval _
                            (Container.DataItem, "State") %><br />
          <b>ZIP: </b><%# DataBinder.Eval _
                            (Container.DataItem, "Zip") %><br />
          <b>Phone: </b><%# DataBinder.Eval _ 
                            (Container.DataItem, "Phone") %><br />
          </div>
      </template>
  </asp:DataList>

</body>
</html>
אני מריץ אותו על שרת שתומך בasp.net 2 ומקבל את השגיאה:
קוד:
Parser Error Message: Code blocks are not supported in this context.
האם יתכן שזה נובע מהבדלי גירסאות ASP.net?
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 21:39.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ