Bin folder

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

    Bin folder

    I would like to put an access db in the bin folder and not hard code it.

    Code: <-- I would like to do this:( when I try it, it does not work)
    string sConnString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
    Source=Project. mdb";

    Instead of this:, <--this work fine
    string sConnString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
    Source=E:\\Fred dy\\Projects\\v b.net\\Project Track It\\bin\\Projec t.mdb";




  • Carlos J. Quintero [.NET MVP]

    #2
    Re: Bin folder

    If the exe and the mdb are together in the same bin folder, then you can get
    the full path without hardcoding it, just getting the path portion of
    System.Reflecti on.Assembly.Get ExecutingAssemb ly.Location.

    --

    Best regards,

    Carlos J. Quintero

    MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
    You can code, design and document much faster.
    Free resources for add-in developers:
    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


    "freddy" <freddy@discuss ions.microsoft. com> escribió en el mensaje
    news:CD417B08-46BE-4DC2-9E42-212C9FE323DC@mi crosoft.com...[color=blue]
    >I would like to put an access db in the bin folder and not hard code it.
    >
    > Code: <-- I would like to do this:( when I try it, it does not work)
    > string sConnString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
    > Source=Project. mdb";
    >
    > Instead of this:, <--this work fine
    > string sConnString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
    > Source=E:\\Fred dy\\Projects\\v b.net\\Project Track It\\bin\\Projec t.mdb";
    >
    >
    >
    >[/color]

    Comment

    Working...