How to get images dynamically from database without file paths in the table field

I have a MS-Access database. I am working with ASP.NET. In the database there is product table in which I have "CodeNo" as a field which is a text field, and the product codes like "SM-R-2035". I also have another field "Image" which is also a text field and which have a file path in it corresponding to the particular product Image (e.g. Images\Products\SM-R-2035.jpg). So far every thing is ok. I have to update this site very frequently and lots of images are added each and every time. Its a tedious work to type the paths and file name every time and it also take a lot of time.
What I am asking is : Is it possible to get images from a specific folder at runtime which is referenced by the "code no" itself and not the file path from the database. (Say at run time the "code no" is referenced from the database and the corresponding image is loaded dynamically from the specified folder). In other word I want to avoid the tedious work of typing.
Can any one help with this issue. Any other simple suggestions are welcome.

All you need to do is simple concatenation to obtain the path for the image file.  You didn't mention whether you are using VB.Net, C# or some other language to do your coding.
If the code in your database is SM-R-2035, the file name is SM-R-2035.jpg and the path to the images foilder is Images\Products\SM-R-2035.jpg, Conceptually here is what you need to do:
dim code_var
dim path_var
code_var = the code you obtain from your relevant field in the database
path_var = "Images\Products\" & code_var & ".jpg"
Now path_var is what you would call to obtain the image from your images folder.

Similar Messages

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • How to get all request from database between two dates in servlets

    I am having a servlet in which i am I accepting two form values i.e 'fromdate' and 'todate' by using req.getParameter(fromdate & todate).
    Now i have to query a table called REQUEST which has 4 columns like req_id, name, createdate and status.
    In the servlet I would like to retrieve all the request during that period say for example. between 1st July to 31stJuly, and then display it on the browser with all req_id(first column in the table) having a hyperlink to another XML file which consists of all the details when a user had send his request in the month of July.
    The output on the browser is preferable in a Table format which has to be created dynamically depending the number of request.
    Kindly let me know how I can proceed with this .
    Thanks,
    Regards,
    Lijoy

    The topic seems a little broad.
    The SQL would look something like
    select req_id, name, createdate, status
    from request
    where createdate > fromdate and <= todate

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to get all TextFrame from ImportedPage INDD Files?

    Hi everyone!
    Do you know the javascript scripts to get all textFrames in importedPage (.indd file)? Is it posible to do that or have some trick to do it?

    Use
    JDR_UTILS.LISTDOCUMENTS
    Use this API to list of all OA Framework the documents in a path/module. This script is very handy, as it provides a list of all the desired documents/extensions/personalizations in one go.
    DECLARE
    BEGIN
    jdr_utils.listdocuments('/oracle/apps/po/setup', TRUE);
    END;
    Thanks
    --Anil
    oracleanil.blogspot.com

  • How to get full row from F4 pop up window into selection-screen fields

    HI ,
    I had a selection screen having 3 fields (vbeln, posnr, ebeln )
    If i press F4 on field 1 i will get a pop up having all values.
    If i click on any one row in that popup, only the first field is getting filled with the value. But i want all the other fields to be filled with the corresponding values in the screen simultaneously.
    Please let me know is there any solution for this...
    Regards,
    Kanth....

    Hi
    U should base your selection-screen on a dictionary structure whith those three fields where you assign your search help exporting all values (VBELN, POSNR and EBELN).
    In this way you'll obtain what you need automatically
    Else you can manage it in POV event by your selef.
    Max

  • How do I stop ID from assigning a paragraph style to the TABLES?

    In-Design is adding "H1" paragraph style to EVERY table is inserted, so the table headers formatting is affected by that H1 style.
    I guess it chooses H1 because it's the FIRST style I created (and then modified the "basic paragraph" to modify the rest of default text).
    It's like it's adding "Style_ID=1"
    I tried placing the character in different places, to make sure it's not the style the cursor is in which is inherited, and no, no matter where I place the cursor, when I "insert table" the cursor is automatically placed into the first cell (header cell) and the paragraph "H1" is selected (and applied)
    Adding a table with NO headers does the same, so it's not me that confused style names and applied some to the wrong place.
    H1 is not used and table and cells styles are not based in it.
    I don't know whether it's a bug, but IT FEELS like a bug.
    How do I expect it to work?
    I expect that by creating a table, NO style be applied other than the table's. (Not even the basic one)

    You might have set the default paragraph style for the document (which you set by selecting a paragraph style with no text frame selected) to your H1 paragraph style.
    Make sure it's on "Basic paragraph" when you select the type tool..

  • How to get image out from LONG RAW from the database

    Dear fellow Oracle users
    I have a table about 50,000 rows one of the the column is LONG RAW.. and we store image files within this column ... almost 99% is gif format.
    Does anyone able to recommand a way to get ALL these images out of the database and save it into a directory. May be a batch process or may be some kind of tools?
    Not all the rows consists of images (i.e some of the the long raw can be null for some row) .
    Any sample codes are very much appreciated...(I am okay with PL/SQL , a little rusty with Java coding but okay to pick it up again...)
    regards
    Ivan

    Hi,
    if u are using oracle forms than u can integrate Webutil with it, there are many function available within webutil to do this.
    Thanks

  • How to get Date value from database and display them in a drop down list?

    Hello.
    In my Customers table, I have a column with Date data type. I want to create a form in JSP, where visitors can filter Customers list by year and month.
    All I know is this piece of SQL that is convert the date to the dd-mm-yyyy format:
    SELECT TO_CHAR(reg_date,'dd-mm-yyyy') from CustomersAny ideas of how this filtering possible? In my effort not to sound like a newbie wanting to be spoonfed, you can provide me link to external notes and resources, I'll really appreciate it.
    Thanks,
    Rightbrainer.

    Hi
    What part is your biggest problem?? I am not experienced in getting data out of a database, but the way to get a variable amount of data to show in a drop down menu, i have just messed around with for some time and heres how i solved it... In my app, what i needed was, a initial empty drop down list, and then using input from a text-field, users could add elements to a Vector that was passed to a JComboBox. Heres how.
    package jcombobox;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.*;
    public class Main extends JApplet implements ActionListener {
        private Vector<SomeClass> list = new Vector<SomeClass>();
        private JComboBox dropDownList = new JComboBox(list);
        private JButton addButton = new JButton("add");
        private JButton remove = new JButton("remove");
        private JTextField input = new JTextField(10);
        private JPanel buttons = new JPanel();
        public Main() {
            addButton.addActionListener(this);
            remove.addActionListener(this);
            input.addActionListener(this);
            buttons.setLayout(new FlowLayout());
            buttons.add(addButton);
            buttons.add(remove);
            add(dropDownList, "North");
            add(input, "Center");
            add(buttons, "South");
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == addButton) {
                list.addElement(new SomeClass(input.getText()));
                input.setText("");
            } else if (e.getSource() == remove) {
                int selected = dropDownList.getSelectedIndex();
                dropDownList.removeItemAt(selected);
        public void init(String[] args) {
            setSize(400,300);
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(new Main());
    }And that "SomeClass" is show here
    package jcombobox;
    public class SomeClass {
        private String text;
        public SomeClass(String input) {
            text = input;
        public String toString() {
            return text;
    }One of the things i struggled a lot with was to get the dropdown menu to show some usefull result. If the list just contains class references it will show the memory code that points to that class. Thats where the toString cones in handy. But it took me some time to figure that one out, a laugh here is welcome as it should have been obvious :-)
    When the app is as simple as this one, using a <String> vector would have been easier, but this is just to demonstrate how to place classes in a vector and get some usefull info out of it, hope this answered some of your question :-)
    The layout might have been easier to write, than using the toppanel created by the JApplet and then the two additional JPanels, but it was just a small app brewed together in 15 minutes. Please comments on my faults, so that i can learn of it.
    If you need any of the code specified more, please let me know. Ill be glad to,

  • How to get log information from database server?

    Oracle 9.2 in Unix
    we got blocking error in the production database last midnight for 40 min and nothing was being processed during that time which delayed our production night batch process. Then it was gone after 40min. I like to know what was happening during that time in the database. My question is where I can find error in the database server? In bdump? Appreciate any ideas.
    Thanks
    S.

    If you have jobs regularly collect statspack report, then it will be easier to troubleshoot. You can just pull the report from the time period.
    A couple of things you can check if there's any storage issue during the time, like some backup or other jobs running taken all OS storage, so Oracle hung because no space to archive logs. Usually this will log errors in alert.log but if bdump destination also full, the error will not be logged.
    Check OS activity during the time frame, what's CPU and IO activity. See if you have sar installed and configured
    check OS message file.

  • How to get custom columns from Database in BO Universe

    Hi,
    We have 'n' databases. All the databases have identical tables and views but some tables in few database have custom columns.
    Ex. 'database1' has table 'sites' with the following columns
           1. sitenumber
           2. sitename
           3. siteaddress
           4. phone
           5. email
    'database2' has table 'sites' with the following columns
           1. sitenumber
           2. sitename
           3. siteaddress
           4. phone
           5. email
           6. IsDepot
    The condition says that
    "If IsDepot field is present in the site table then list sites where IsDepot equals 0 or null otherwise list all sites"
    How do i create a condition at the universe level which checks whether the object 'IsDepot" is present in the database or not.
    A single universe needs to be created for this purpose

    Hi,
    We have implemented a solution for the IsDepot problem as mentioned above.
    It is not done at the BO Universe level but at the SQL Server database level.
    Steps Followed:
    1. Created a stored procedure which checks the 'syscolumns' table for available fields
    2. The SP creates a temp table with a value list based on previously mentioned conditions
    3. This temp table can be used in the universe or a condition can be used to filter data based on this temp table.
    Thanks,
    Arun

  • ASP / PHP pages: How to get streaming info from a XML file?

    Hi all
    I am using Adobe Flash Media Streaming Server 3.5 but I can't find any output file (fx a xml file) that I can pull out info from and use on my website via a PHP or ASP script. It could be nice - in the website - to retrieve info like "online users attending", "running / streaming state" (online or offline) and other relevant info about the streaming, so I on the website can display how many that are online when a webtv event is streaming.
    I see the the info when I login at the web admin for FMS, but I need a solution that can work with ASP or PHP.
    I simply can't find any file / address to get this kind or output out of FMS - can you help?
    Thank you
    Kind regards,
    Jens

    hi,
    can you share php code for grabbing data. i make php code using "simplexml_load_file" but the problem is it takes 2-3 minutes before it show the result. i want to monitor the current video if stop feeding.
    http://server1:1111/admin/getLiveStreams?auser=admin&apswd=admin&appInst=appname
    xml
    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <result> 
    <level>status</level> 
    <code>NetConnection.Call.Success</code>
    <timestamp>3/21/2015 7:47:17 AM</timestamp>
    <name>_defaultRoot_:_defaultVHost_:::_0</name>
    <data> 
    <_0>appname</_0> 
    </data>
    </result>
    here;s my php code:amsstats.php
    <?php
        $result = simplexml_load_file("http://server1:1111/admin/getLiveStreams?auser=admin&apswd=admin&appInst=appname");
        echo $result->data[0]->_0;
    ?>
    result:
    http://server2/stats/amsstats.php

  • HT5621 how to get my apps from my old apple id to the new one ?

    hi, i have an old apple id which i dont use that email anymore , i just use it as apple ID, how can I bring all my apps to my new apple I

    You cannot.
    All purchases will always be tied to the account from which they were purchased.
    Why would you start a new account? Just update the email address for the original account

  • How to get List Item attachments name without write any custom code or any database query?

    Hi,
    How to get List Items attachments name without write any custom code or any database query?

    You can get it from Rest,
    There are 2 options,
    1) create a 'Result Source' which has a search query for that List which has attachments 
     - Use rest query to get the 'Filename' , it will have the attachment file name 
    For example, if the result source id is : 73e6b573-abf8-4407-9e5f-8a85a4a95159 , then the query will be 
    http://[site URL]/_api/search/query?querytext='*'&selectproperties='Title,Path,FileExtension,SecondaryFileExtension,Filename'&sourceid='73e6b573-abf8-4407-9e5f-8a85a4a95159'&startrow=0&rowLimit=100
    You can refine the query, be giving proper 'querytext'
    2) Use the List rest api
    For example if your list guid is :38d524a1-e95c-439f-befd-9ede6ecd242e
    You can get he attachments for 1st item using this 
    http://[Site URL]/_api/lists(guid'38d524a1-e95c-439f-befd-9ede6ecd242e')/items(1)/AttachmentFiles
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • How to sync different image folders from pc without removing images from ipad

    how to sync different image folders from pc without removing images from ipad as ipad asks to replace the already existing images in ipad with the pc folder.

    Spare yourself the frustration, use Photo Manager Pro.
    https://itunes.apple.com/sg/app/photo-manager-pro/id393858562?mt=8

Maybe you are looking for

  • KT4 Ultra BIOS 1.4 Released

    I've not tested it yet but here it is. http://www.msi.com.tw/program/support/bios/bos/spt_bos_detail.php?UID=356&NAME=MS-6590

  • AP losing connectivity to Controller

    2602 AP loosing connectivity to 5508 running 7.4.110.0. This very well could be happening during higher traffic periods -AP has been moved to another port and even to another switch -AP was even replace with a new one -Apparently there are other APs

  • Detecting the type of Internet Connection

    Hi.. I am trying ... build an application that detects the kind of internet connection (Dial-up, T1, DSL etc) that you are using and then disconnects it. This application, must then send a response to a server-side program containing information abou

  • Multi Language Dashboards

    Hi, I am trying to create a dashboard which supports multiple languages. I am only to trying to change the labels to the appropriate language. For example, on my dashboard I have a label called "Year", based on the users InfoView locale I would like

  • Transformation Routine

    Hi In my customer master data, I have a customer group field attached to each customer along with other fields/ attributes of customer. Now i have data going to a cube through a routine in the transformation, which works fine. Now i see a problem. A