473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

User controls and relative paths

I am trying to get somewhere with user controls and have come up against an
obstacle with using relative paths.

I have a dataset in my user control, and have tried to enter the path with
the following:-

dsResultsTable.ReadXml(Application.StartupPath &
"\Textfiles\ResultsTable.xml")

It does not like this, as it takes the application path to be C:\Program
Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe.
I have also tried to send the path into the user control as a variable,
using a property - it does not like this either, as it is again looking for
the path above as I try and place the control on my page..
Can anyone point me to a possible solution and explain where I am going
wrong. Why cannot I pass the path in as a property??

ResultsPathXML is being sent to the user control as
(Application.StartupPath & "\Textfiles\ResultsTable.xml"), and I have this
in the Load of my form that is using the control.
Finally are there any good - ? web-based resources to help me with user
controls, using the Usercontrol class, as I think that this will avoid me
doing a lot of repetitive coding in my applications.

Many thanks - Paul Bromley

Public Class ctlSendResultsEMIS
Inherits System.Windows.Forms.UserControl
Private sLabFilter As String
Private sLabResult As String
Private sLabCode As String
Private dsResultsTable As New DataSet()
Private dvResultsTable As New Data.DataView()
Private sResultsPath As String '= (Application.StartupPath &
"\Textfiles\ResultsTable.xml")
Property ResultsPathXML() As String
Get ' Retrieves the value of the private variable.
Return sResultsPath
End Get ' Stores the selected value in the private variable txtTrialText
Set(ByVal Value As String)
sResultsPath = Value
End Set
End Property
Later in the code:-

Private Sub ctlSendResultsEMIS_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
dsResultsTable.ReadXml(sResultsPath)
dvResultsTable = dsResultsTable.Tables(0).DefaultView '.DefaultView
GridResults.DataSource = dvResultsTable
End Sub
Nov 20 '05 #1
0 1751

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
2
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
2
by: Alex | last post by:
Hi. I need some help on this. I have a user control (a header) in my root directory, and all my pages use that control. Then a created a folder (in my root directory) and put a new page inside it,...
2
by: ALI-R | last post by:
Hi I've created a bunch user comtrols for the footer,header,navigation bar of a webpage ,I have two problems: 1) All the controls are in the folder "Control" of the root and all the images...
0
by: Paul Hatcher | last post by:
I'm using a url rewriting mechanism to make my site's urls more search-engine/user-friendly, so we have http://www.mysite.com/links/1023.apx which is actually internally mapped to...
9
by: Paul Hatcher | last post by:
Sorry to post this again - I didn't use my MSDN alias previously... I'm using a url rewriting mechanism to make my site's urls more search-engine/user-friendly, so we have...
2
by: tsteinke | last post by:
Okay here is the situation I am developing a ASP.Net application locally and then I copy the project up to my web server. I start out by creating an ASP.NET Application ...
8
by: Paul Bromley | last post by:
I am trying to get somewhere with user controls and have come up against an obstacle with using relative paths. I have a dataset in my user control, and have tried to enter the path with the...
11
by: MBS | last post by:
I am playing around with some PHP code. I want to put in an include() function so I can include existing HTML code and output it to the browser. Lo and behold PHP does not support relative paths...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.