File Path in application code

  • Thread starter Thread starter Samuel Shulman
  • Start date Start date
S

Samuel Shulman

Hi all

I would like to reference a file in a class in the 'App_Code' folder and I
wanted to use the server.MapPath property

How can I do that?

Samuel
 
A File Path

I want to stae the path of a datbase (.mdb) file but instead of stating the
absolute path I want to state the relative path so I wanted to use the
server.Mappath property

Thank you,
Samuel
 
Samuel,

It is not clear at all what you are asking for. Can you give an example in
pseudo code?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
 
I simply want to create a connection string using the server.mappath to a
database file that resides in a sub folder in the website



Eliyahu Goldin said:
Samuel,

It is not clear at all what you are asking for. Can you give an example in
pseudo code?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
A File Path

I want to stae the path of a datbase (.mdb) file but instead of stating
the absolute path I want to state the relative path so I wanted to use
the server.Mappath property

Thank you,
Samuel
 
So what is your problem with MapPath method?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
I simply want to create a connection string using the server.mappath to a
database file that resides in a sub folder in the website



Eliyahu Goldin said:
Samuel,

It is not clear at all what you are asking for. Can you give an example
in pseudo code?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
A File Path

I want to stae the path of a datbase (.mdb) file but instead of stating
the absolute path I want to state the relative path so I wanted to use
the server.Mappath property

Thank you,
Samuel

message How can you have a "file in a class"? confused.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

Hi all

I would like to reference a file in a class in the 'App_Code' folder
and I
wanted to use the server.MapPath property

How can I do that?

Samuel
 
It simply doesn't work (the class is under the 'App_Code' folder)


Eliyahu Goldin said:
So what is your problem with MapPath method?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
I simply want to create a connection string using the server.mappath to a
database file that resides in a sub folder in the website



Eliyahu Goldin said:
Samuel,

It is not clear at all what you are asking for. Can you give an example
in pseudo code?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


A File Path

I want to stae the path of a datbase (.mdb) file but instead of stating
the absolute path I want to state the relative path so I wanted to use
the server.Mappath property

Thank you,
Samuel

message How can you have a "file in a class"? confused.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

Hi all

I would like to reference a file in a class in the 'App_Code' folder
and I
wanted to use the server.MapPath property

How can I do that?

Samuel
 
It does. Likely something is not 100% right on your side. You can make this
thread more productive if you tell what you pass to the method, what you
expect and what you get.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
It simply doesn't work (the class is under the 'App_Code' folder)


Eliyahu Goldin said:
So what is your problem with MapPath method?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
I simply want to create a connection string using the server.mappath to a
database file that resides in a sub folder in the website



message Samuel,

It is not clear at all what you are asking for. Can you give an example
in pseudo code?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


A File Path

I want to stae the path of a datbase (.mdb) file but instead of
stating the absolute path I want to state the relative path so I
wanted to use the server.Mappath property

Thank you,
Samuel

message How can you have a "file in a class"? confused.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

Hi all

I would like to reference a file in a class in the 'App_Code' folder
and I
wanted to use the server.MapPath property

How can I do that?

Samuel
 
Back
Top