relative path problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mostafa

    #1

    relative path problem

    Hello,

    I need to use a relative URL path instead of the system path inside the
    <wmx:> tag in the following code:

    <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
    SelectCommand=" SELECT * FROM [ContactInfo]"
    ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
    Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>


    I have tried to do it this way,

    <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
    SelectCommand=" SELECT * FROM [ContactInfo]"
    ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
    Source=" &
    Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>

    But I always get a parser error. It seems that functions cannot be evaluated
    within the tag.

    Please help me

    Thank you

    Mostafa


  • Patrik Löwendahl

    #2
    Re: relative path problem

    You need to include the vb.net code within server script tags like so:

    <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
    SelectCommand=" SELECT * FROM [ContactInfo]"
    ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
    Source=" &
    <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>[color=blue]
    ></wmx:AccessDataS ourceControl>[/color]

    --
    Patrik Löwendahl
    cshrp.net - " Elegant code by witty programmers "
    cornerstone.se - " IT Training for professionals "

    "Mostafa" <mostafa@nospam .com> wrote in message
    news:RmZlb.1670 4$B_2.9560@okep read02...[color=blue]
    > Hello,
    >
    > I need to use a relative URL path instead of the system path inside the
    > <wmx:> tag in the following code:
    >
    > <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
    > SelectCommand=" SELECT * FROM [ContactInfo]"
    > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;[/color]
    Data[color=blue]
    > Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
    >
    >
    > I have tried to do it this way,
    >
    > <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
    > SelectCommand=" SELECT * FROM [ContactInfo]"
    > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;[/color]
    Data[color=blue]
    > Source=" &
    > Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>
    >
    > But I always get a parser error. It seems that functions cannot be[/color]
    evaluated[color=blue]
    > within the tag.
    >
    > Please help me
    >
    > Thank you
    >
    > Mostafa
    >
    >[/color]


    Comment

    • Mostafa

      #3
      Re: relative path problem

      It is still not working:

      Parser Error
      Description: An error occurred during the parsing of a resource required to
      service this request. Please review the following specific parse error
      details and modify your source file appropriately.

      Parser Error Message: The server tag is not well formed.

      Source Error:

      Line 22: </p>
      Line 23: <p>
      Line 24: <wmx:AccessData SourceControl
      id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM
      [ContactInfo]" ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB
      Services=-4; Data Source=" & <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>[color=blue]
      ></wmx:AccessDataS ourceControl>[/color]
      Line 25:
      Line 26: <wmx:MxDataGr id id="MxDataGrid1 " runat="server"
      AutoGenerateFie lds="False" DataKeyField="M essageID" DataMember="Con tactInfo"
      DataSourceContr olID="AccessDat aSourceControl1 " BorderColor="#C CCCCC"
      AllowSorting="T rue" BackColor="Whit e" CellPadding="3" BorderWidth="1p x"
      BorderStyle="No ne">

      Source File: D:\nrcweb2\cont act2.aspx Line: 24


      Mostafa


      "Patrik Löwendahl" <patrik.lowenda hl@csharpsweden .com> wrote in message
      news:OnmZQ3bmDH A.1708@TK2MSFTN GP12.phx.gbl...[color=blue]
      > You need to include the vb.net code within server script tags like so:
      >
      > <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
      > SelectCommand=" SELECT * FROM [ContactInfo]"
      > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;[/color]
      Data[color=blue]
      > Source=" &
      > <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>[color=green]
      > ></wmx:AccessDataS ourceControl>[/color]
      >
      > --
      > Patrik Löwendahl
      > cshrp.net - " Elegant code by witty programmers "
      > cornerstone.se - " IT Training for professionals "
      >
      > "Mostafa" <mostafa@nospam .com> wrote in message
      > news:RmZlb.1670 4$B_2.9560@okep read02...[color=green]
      > > Hello,
      > >
      > > I need to use a relative URL path instead of the system path inside the
      > > <wmx:> tag in the following code:
      > >
      > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color][/color]
      runat="server"[color=blue][color=green]
      > > SelectCommand=" SELECT * FROM [ContactInfo]"
      > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;[/color]
      > Data[color=green]
      > > Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
      > >
      > >
      > > I have tried to do it this way,
      > >
      > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color][/color]
      runat="server"[color=blue][color=green]
      > > SelectCommand=" SELECT * FROM [ContactInfo]"
      > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;[/color]
      > Data[color=green]
      > > Source=" &
      > > Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>
      > >
      > > But I always get a parser error. It seems that functions cannot be[/color]
      > evaluated[color=green]
      > > within the tag.
      > >
      > > Please help me
      > >
      > > Thank you
      > >
      > > Mostafa
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Patrik Löwendahl

        #4
        Re: relative path problem

        Sorry, remove the & and ad an ending "

        --
        Patrik Löwendahl
        cshrp.net - " Elegant code by witty programmers "
        cornerstone.se - " IT Training for professionals "

        "Mostafa" <mostafa@nospam .com> wrote in message
        news:_YZlb.1680 3$B_2.13775@oke pread02...[color=blue]
        > It is still not working:
        >
        > Parser Error
        > Description: An error occurred during the parsing of a resource required[/color]
        to[color=blue]
        > service this request. Please review the following specific parse error
        > details and modify your source file appropriately.
        >
        > Parser Error Message: The server tag is not well formed.
        >
        > Source Error:
        >
        > Line 22: </p>
        > Line 23: <p>
        > Line 24: <wmx:AccessData SourceControl
        > id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT * FROM
        > [ContactInfo]" ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB
        > Services=-4; Data Source=" & <%# Server.MapPath(/nrcweb2/db/contact.mdb")[/color]
        %>[color=blue][color=green]
        > ></wmx:AccessDataS ourceControl>[/color]
        > Line 25:
        > Line 26: <wmx:MxDataGr id id="MxDataGrid1 " runat="server"
        > AutoGenerateFie lds="False" DataKeyField="M essageID"[/color]
        DataMember="Con tactInfo"[color=blue]
        > DataSourceContr olID="AccessDat aSourceControl1 " BorderColor="#C CCCCC"
        > AllowSorting="T rue" BackColor="Whit e" CellPadding="3" BorderWidth="1p x"
        > BorderStyle="No ne">
        >
        > Source File: D:\nrcweb2\cont act2.aspx Line: 24
        >
        >
        > Mostafa
        >
        >
        > "Patrik Löwendahl" <patrik.lowenda hl@csharpsweden .com> wrote in message
        > news:OnmZQ3bmDH A.1708@TK2MSFTN GP12.phx.gbl...[color=green]
        > > You need to include the vb.net code within server script tags like so:
        > >
        > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color][/color]
        runat="server"[color=blue][color=green]
        > > SelectCommand=" SELECT * FROM [ContactInfo]"
        > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4;[/color]
        > Data[color=green]
        > > Source=" &
        > > <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>[color=darkred]
        > > ></wmx:AccessDataS ourceControl>[/color]
        > >
        > > --
        > > Patrik Löwendahl
        > > cshrp.net - " Elegant code by witty programmers "
        > > cornerstone.se - " IT Training for professionals "
        > >
        > > "Mostafa" <mostafa@nospam .com> wrote in message
        > > news:RmZlb.1670 4$B_2.9560@okep read02...[color=darkred]
        > > > Hello,
        > > >
        > > > I need to use a relative URL path instead of the system path inside[/color][/color][/color]
        the[color=blue][color=green][color=darkred]
        > > > <wmx:> tag in the following code:
        > > >
        > > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color][/color]
        > runat="server"[color=green][color=darkred]
        > > > SelectCommand=" SELECT * FROM [ContactInfo]"
        > > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB[/color][/color][/color]
        Services=-4;[color=blue][color=green]
        > > Data[color=darkred]
        > > > Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
        > > >
        > > >
        > > > I have tried to do it this way,
        > > >
        > > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color][/color]
        > runat="server"[color=green][color=darkred]
        > > > SelectCommand=" SELECT * FROM [ContactInfo]"
        > > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB[/color][/color][/color]
        Services=-4;[color=blue][color=green]
        > > Data[color=darkred]
        > > > Source=" &
        > > >[/color][/color][/color]
        Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>[color=blue][color=green][color=darkred]
        > > >
        > > > But I always get a parser error. It seems that functions cannot be[/color]
        > > evaluated[color=darkred]
        > > > within the tag.
        > > >
        > > > Please help me
        > > >
        > > > Thank you
        > > >
        > > > Mostafa
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Mostafa

          #5
          Re: relative path problem

          I am sorry but I tried this one and it still doesn't work.

          <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
          ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
          Source= <%# Server.MapPath( "/nrcweb2/db/contact.mdb") %>"
          SelectCommand=" SELECT * FROM [ContactInfo]"></wmx:AccessDataS ourceControl>

          The parser assumes the end of the string once it encounters an " . I have
          tried ' instead of " but still doesn't work, although it gives different
          error:

          <wmx:AccessData SourceControl id="AccessDataS ourceControl1" runat="server"
          ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB Services=-4; Data
          Source= <%# Server.MapPath( '/nrcweb2/db/contact.mdb') %>"
          SelectCommand=" SELECT * FROM [ContactInfo]"></wmx:AccessDataS ourceControl>

          Can you please write the complete corrected tag?

          Sorry for the trouble, I appreciate your help

          Mostafa

          "Patrik Löwendahl" <patrik.lowenda hl@csharpsweden .com> wrote in message
          news:u9sybIcmDH A.2964@tk2msftn gp13.phx.gbl...[color=blue]
          > Sorry, remove the & and ad an ending "
          >
          > --
          > Patrik Löwendahl
          > cshrp.net - " Elegant code by witty programmers "
          > cornerstone.se - " IT Training for professionals "
          >
          > "Mostafa" <mostafa@nospam .com> wrote in message
          > news:_YZlb.1680 3$B_2.13775@oke pread02...[color=green]
          > > It is still not working:
          > >
          > > Parser Error
          > > Description: An error occurred during the parsing of a resource required[/color]
          > to[color=green]
          > > service this request. Please review the following specific parse error
          > > details and modify your source file appropriately.
          > >
          > > Parser Error Message: The server tag is not well formed.
          > >
          > > Source Error:
          > >
          > > Line 22: </p>
          > > Line 23: <p>
          > > Line 24: <wmx:AccessData SourceControl
          > > id="AccessDataS ourceControl1" runat="server" SelectCommand=" SELECT *[/color][/color]
          FROM[color=blue][color=green]
          > > [ContactInfo]" ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole[/color][/color]
          DB[color=blue][color=green]
          > > Services=-4; Data Source=" & <%#[/color][/color]
          Server.MapPath(/nrcweb2/db/contact.mdb")[color=blue]
          > %>[color=green][color=darkred]
          > > ></wmx:AccessDataS ourceControl>[/color]
          > > Line 25:
          > > Line 26: <wmx:MxDataGr id id="MxDataGrid1 " runat="server"
          > > AutoGenerateFie lds="False" DataKeyField="M essageID"[/color]
          > DataMember="Con tactInfo"[color=green]
          > > DataSourceContr olID="AccessDat aSourceControl1 " BorderColor="#C CCCCC"
          > > AllowSorting="T rue" BackColor="Whit e" CellPadding="3" BorderWidth="1p x"
          > > BorderStyle="No ne">
          > >
          > > Source File: D:\nrcweb2\cont act2.aspx Line: 24
          > >
          > >
          > > Mostafa
          > >
          > >
          > > "Patrik Löwendahl" <patrik.lowenda hl@csharpsweden .com> wrote in message
          > > news:OnmZQ3bmDH A.1708@TK2MSFTN GP12.phx.gbl...[color=darkred]
          > > > You need to include the vb.net code within server script tags like so:
          > > >
          > > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color][/color]
          > runat="server"[color=green][color=darkred]
          > > > SelectCommand=" SELECT * FROM [ContactInfo]"
          > > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB[/color][/color][/color]
          Services=-4;[color=blue][color=green]
          > > Data[color=darkred]
          > > > Source=" &
          > > > <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
          > > > ></wmx:AccessDataS ourceControl>
          > > >
          > > > --
          > > > Patrik Löwendahl
          > > > cshrp.net - " Elegant code by witty programmers "
          > > > cornerstone.se - " IT Training for professionals "
          > > >
          > > > "Mostafa" <mostafa@nospam .com> wrote in message
          > > > news:RmZlb.1670 4$B_2.9560@okep read02...
          > > > > Hello,
          > > > >
          > > > > I need to use a relative URL path instead of the system path inside[/color][/color]
          > the[color=green][color=darkred]
          > > > > <wmx:> tag in the following code:
          > > > >
          > > > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color]
          > > runat="server"[color=darkred]
          > > > > SelectCommand=" SELECT * FROM [ContactInfo]"
          > > > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB[/color][/color]
          > Services=-4;[color=green][color=darkred]
          > > > Data
          > > > > Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataS ourceControl>
          > > > >
          > > > >
          > > > > I have tried to do it this way,
          > > > >
          > > > > <wmx:AccessData SourceControl id="AccessDataS ourceControl1"[/color]
          > > runat="server"[color=darkred]
          > > > > SelectCommand=" SELECT * FROM [ContactInfo]"
          > > > > ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0; Ole DB[/color][/color]
          > Services=-4;[color=green][color=darkred]
          > > > Data
          > > > > Source=" &
          > > > >[/color][/color]
          > Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataS ourceControl>[color=green][color=darkred]
          > > > >
          > > > > But I always get a parser error. It seems that functions cannot be
          > > > evaluated
          > > > > within the tag.
          > > > >
          > > > > Please help me
          > > > >
          > > > > Thank you
          > > > >
          > > > > Mostafa
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...