relative path problem

M

Mostafa

Hello,

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataSourceControl>


I have tried to do it this way,

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataSourceControl>

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

Please help me

Thank you

Mostafa
 
P

Patrik Löwendahl

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=" &
</wmx:AccessDataSourceControl>

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

Mostafa said:
Hello,

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataSourceControl>


I have tried to do it this way,

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataSourceControl>

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

Please help me

Thank you

Mostafa
 
M

Mostafa

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:AccessDataSourceControl
id="AccessDataSourceControl1" runat="server" SelectCommand="SELECT * FROM
[ContactInfo]" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; Data Source=" & said:
</wmx:AccessDataSourceControl>
Line 25:
Line 26: <wmx:MxDataGrid id="MxDataGrid1" runat="server"
AutoGenerateFields="False" DataKeyField="MessageID" DataMember="ContactInfo"
DataSourceControlID="AccessDataSourceControl1" BorderColor="#CCCCCC"
AllowSorting="True" BackColor="White" CellPadding="3" BorderWidth="1px"
BorderStyle="None">

Source File: D:\nrcweb2\contact2.aspx Line: 24


Mostafa


Patrik Löwendahl said:
You need to include the vb.net code within server script tags like so:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=" &
</wmx:AccessDataSourceControl>

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

Mostafa said:
Hello,

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataSourceControl>


I have tried to do it this way,

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")></wmx:AccessDataSourceControl>

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

Please help me

Thank you

Mostafa
 
P

Patrik Löwendahl

Sorry, remove the & and ad an ending "

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

Mostafa said:
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:AccessDataSourceControl
id="AccessDataSourceControl1" runat="server" SelectCommand="SELECT * FROM
[ContactInfo]" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; Data Source=" & <%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataSourceControl>
Line 25:
Line 26: <wmx:MxDataGrid id="MxDataGrid1" runat="server"
AutoGenerateFields="False" DataKeyField="MessageID" DataMember="ContactInfo"
DataSourceControlID="AccessDataSourceControl1" BorderColor="#CCCCCC"
AllowSorting="True" BackColor="White" CellPadding="3" BorderWidth="1px"
BorderStyle="None">

Source File: D:\nrcweb2\contact2.aspx Line: 24


Mostafa


Patrik Löwendahl said:
You need to include the vb.net code within server script tags like so:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=" &
</wmx:AccessDataSourceControl>

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

Mostafa said:
Hello,

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4;
Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataSourceControl>


I have tried to do it this way,

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4;
Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")> said:
But I always get a parser error. It seems that functions cannot be evaluated
within the tag.

Please help me

Thank you

Mostafa
 
M

Mostafa

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source= <%# Server.MapPath("/nrcweb2/db/contact.mdb") %>"
SelectCommand="SELECT * FROM [ContactInfo]"></wmx:AccessDataSourceControl>

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:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source= <%# Server.MapPath('/nrcweb2/db/contact.mdb') %>"
SelectCommand="SELECT * FROM [ContactInfo]"></wmx:AccessDataSourceControl>

Can you please write the complete corrected tag?

Sorry for the trouble, I appreciate your help

Mostafa

Patrik Löwendahl said:
Sorry, remove the & and ad an ending "

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

Mostafa said:
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:AccessDataSourceControl
id="AccessDataSourceControl1" runat="server" SelectCommand="SELECT * FROM
[ContactInfo]" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; Data Source=" & <%#
Server.MapPath(/nrcweb2/db/contact.mdb")
%>
</wmx:AccessDataSourceControl>
Line 25:
Line 26: <wmx:MxDataGrid id="MxDataGrid1" runat="server"
AutoGenerateFields="False" DataKeyField="MessageID" DataMember="ContactInfo"
DataSourceControlID="AccessDataSourceControl1" BorderColor="#CCCCCC"
AllowSorting="True" BackColor="White" CellPadding="3" BorderWidth="1px"
BorderStyle="None">

Source File: D:\nrcweb2\contact2.aspx Line: 24


Mostafa


Patrik Löwendahl said:
You need to include the vb.net code within server script tags like so:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4;
Data
Source=" &
<%# Server.MapPath(/nrcweb2/db/contact.mdb") %>
</wmx:AccessDataSourceControl>

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

Hello,

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

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4;
Data
Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataSourceControl>


I have tried to do it this way,

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"
SelectCommand="SELECT * FROM [ContactInfo]"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4;
Data
Source=" &
Server.MapPath(/nrcweb2/db/contact.mdb")> said:
But I always get a parser error. It seems that functions cannot be
evaluated
within the tag.

Please help me

Thank you

Mostafa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top