ImageIcons read from database don't appear

Hi,
I create a JavaBean to show images from filesystem and database (oracle9i) in a JTable.
The ImageIcons loaded from filesystem appear fine whith my defined DefaultTabelModel.
The ImageIcons read from database (jdbc2) with the same DefaultTabelModel appear in the correct count, but the fields or placeholders of the Images, saved as blob, are blank.
The partcode of my resultset is
BLOB myblob = null;
int bufsize = 0;
while(result.next())
myblob = ((OracleResultSet)result).getBLOB("image_container");
bufsize = myblob.getChunkSize();
byte[] buffer = new byte[bufsize];
ImageIcon icon = new ImageIcon(buffer);
Object [] row = {icon};
model1.addRow(row);
model1.fireTableDataChanged();
I don't get any errors.
Thanks
Klaus

Hi,
I changed the datatype from BLOB to 'LONG RAW' for the image in the database.
while(result.next())
byte[] bytes = result.getBytes(1);
String jd = String.valueOf(bytes);
System.out.println(jd);
//get:[B@153 [B@154
    //or [B@155 [B@156 for the 2.result
    String name = result.getString(2);
    System.out.println(name);
    //get the correct result
    FileOutputStream file = null;
    file = new FileOutputStream ("c:\\"+name+".jpg");
    file.write(bytes);
    //it works fine !!!
    ImageIcon icon = new ImageIcon(bytes);   //it is correct ?
    String ls = String.valueOf(icon.getImageLoadStatus());
    String h = String.valueOf(icon.getIconHeight());
    String w = String.valueOf(icon.getIconWidth());
    System.out.println(h+" : "+w);
    //get: -1 : -1
    System.out.println(ls);
    //get: 4
    Object [] row = {icon,name};
//icon is blank, name appears correct in jtable
//but when I need:
//ImageIcon icon = new ImageIcon(AW_Frame.class.getResource("images/emac.jpg"));
//icon and name appears correct in jtable
model1.addRow(row);
model1.fireTableDataChanged();
any ideas ?
Thanks in advance !

Similar Messages

  • ImageIcons loaded from database don't appear

    Hi,
    I create a JavaBean to show images from filesystem and database (oracle9i) in a JTable.
    The ImageIcons loaded from filesystem appears fine whith my defined DefaultTabelModel.
    The ImageIcons read from database (jdbc2) with the same DefaultTabelModel appears in the correct count, but the fields or placholders of the Images, saved as blob, are blank.
    The code of my resultset
    BLOB myblob = null;
    int bufsize = 0;
    while(result.next())
    myblob = ((OracleResultSet)result).getBLOB("image_container");
    bufsize = myblob.getChunkSize();
    byte[] buffer = new byte[bufsize];
    ImageIcon icon = new ImageIcon(buffer);
    Object [] row = {icon};
    model1.addRow(row);
    model1.fireTableDataChanged();
    I don't get any errors.
    Thanks
    Klaus

    Hi,
    I changed the datatype from BLOB to 'LONG RAW' for the image in the database.
    while(result.next())
    byte[] bytes = result.getBytes(1);
    String jd = String.valueOf(bytes);
    System.out.println(jd);
    //get:[B@153 [B@154
    //or [B@155 [B@156 for the 2.result
    String name = result.getString(2);
    System.out.println(name);
    //get the correct result
    FileOutputStream file = null;
    file = new FileOutputStream ("c:\\"+name+".jpg");
    file.write(bytes);
    //it works fine !!!
    ImageIcon icon = new ImageIcon(bytes); //it is correct ?
    String ls = String.valueOf(icon.getImageLoadStatus());
    String h = String.valueOf(icon.getIconHeight());
    String w = String.valueOf(icon.getIconWidth());
    System.out.println(h+" : "+w);
    //get: -1 : -1
    System.out.println(ls);
    //get: 4
    Object [] row = {icon,name};
    //icon is blank, name appears correct in jtable
    //but when I need:
    //ImageIcon icon = new ImageIcon(AW_Frame.class.getResource("images/emac.jpg"));
    //icon and name appears correct in jtable
    model1.addRow(row);
    model1.fireTableDataChanged();
    any ideas ?
    Thanks in advance !

  • Caching data read from database

    I have a big performace problem in our J2EE application. We use jsp and servlets to process a request. Servlet gets the results from database which are stored in a vector of dataobjects and vector is stored in session. We display only 20 rows in jsp and provide page navigation to view more data by Next and Prev links. The problem is we want to store results in request object instead of session variable but then that data is not availabe for Next and Prev links. We don't want to do another search to view more data. Is there a way to cache the data so that while view more data by page navigation we don't need to hit database since request object would be cleared at that time. I am clueless. I hope I explained the problem properly. Any help on this would be highly appreciated

    You're not clueless, you said it yourself.
    To make info available over multiple requests, you need to use a session variable rather than the request.

  • Sony Reader PRS-505 don't appears on Digital Edition for Mac OSX 10.5

    I now, Sony® Reader PRS-505 appears on Mac as mass storage card, but in the specifications for Digital Editions, it doesn't say any think about that is not support for mac, and I would like to know if the Sony® Reader PRS-505 doesn't appears on my mac because is not supported by Digital Editions on Mac or because I have a problem. If not , Is going to be a support for it on the immediate future.
    Now that Digital Editions offer support for Windows I believe Adobe have to offer parity for Mac.
    Thanks very much.

    I can concur that this Mac workaround does not actually work, for protected digital editions checked out from a public library website.
    The Adobe staffer said that as a one time process, you can authroize the reader itself on a windows machine, by stating "Next, plug in your Sony Reader and then in ADE, select the Reader and choose "Authorize Device" from the Library menu"
    I did not see this option, the only authorize command in the library menu was to authorize the computer, not the reader.
    On my windows machine, my PRS-505 shows up in the Adobe digital editions software, and I verified that the copy of digital editions was registered to my adobe ID (email address). I can use the windows digital editions software to copy checked out titles to the PRS-505 no problem, they last the 3 weeks they are supposed to and open up fine on the 505.
    On the Mac, I can download checked out titles from the library to the mac digital editions software, and read them on the Mac. They last the 3 weeks as expected.
    I can also, using the mac's finder, copy the downloaded digital edition book to the reader, which shows up in the finder as a mass storage device. When I fire up the reader, the transferred titles are there.
    HOWEVER, if I try to actually read the checked out title from the library (that I copied over from the Mac) I get a blank screen that says "not authorized". Going along with this, the title, in the library view on the PRS-505, does not show the little "day counter" that counts down how many days you have from your 21 day borrowing window.
    So yes, you can use the Mac finder to manually copy a downloaded digital edition to the PRS-505, but its not actually authorizing that copied book to the reader, so you can actually READ it on the reader. That authorization process only seems to happen on a PC, when you use the digital editions software to do the copy instead of the Mac finder.
    So I don't think there is an actual workaround, at least not for me.

  • Dynamic reading from database table

    Hi Experts,
    While reading from a database table the below statement for deletion works:
    DELETE (p_table) FROM <fs_wadbtab>.
    p_table: name of database table which is entered as a selection screen parameter
    <fs_wadbtab> : workarea of line type P_table
    However, the below statement does not work:
    READ (p_table) FROM <fs_wadbtab>.
    My requirement is to read a record from p_table with contents in a dynamic structure.
    Kindly suggest.
    Thanks.

    Just misunderstood you.
    Edited by: Karri Kemppi on Jun 23, 2010 10:00 AM

  • Read from database (Access) and update fields using MS ADODB

    Hello,
    I am trying to get records from database using MS ADODB._connection & ADODB._Recordset objects (from LabVIEW 6)
    I can:
    1. open connection (with ADODB._connection)
    2. write into tables (with ADODB._command)
    I can not: gets records and update fields using ADODB._connection & ADODB._Recordset.
    I do not know:
    1. how to connect between the connection that was opened and the recordset object
    2. where I can write the SQL text as input to the recordset
    Attached is DataBase.llb with DB_read.vi that display my steps.
    Thanks.
    Attachments:
    DataBase.llb ‏40 KB

    Try this one, after updating the names for database and the table you want.
    Let me know if it's working.
    p.s.: if you have problems, it could be a different adodb version ... but the sequence of methods is the same
    Attachments:
    EditdatabaseMe.vi ‏57 KB

  • Cannot read from database correctly

    Hi all,
    I'm new to Berkeley DB. I'm trying to write a simple program to create
    a very simple database and then read the data from it.
    I built the Berkeley DB binary correctly and I don't have any syntax
    or linking errors.
    This is the code that I wrote (almost all of it from the "Getting
    Started with Data Storage" Guide).
    #include <sys/types.h>
    #include <iostream>
    #include <iomanip>
    #include <errno.h>
    #include <stdlib.h>
    #include <string.h>
    #include <stdio.h>
    #include <db_cxx.h>
    using std::cin;
    using std::cout;
    using std::cerr;
    void main()
    Db db(NULL, 0); // Instantiate the Db object
    u_int32_t oFlags = DB_CREATE; // Open flags;
    try {
    db.open(NULL,"my_db.db",NULL, DB_HASH, oFlags, 0); // Open the
    database
    } catch(DbException &e) {
    std::cerr << "Error opening database: " << "my_db.db" << "\n";
    std::cerr << e.what() << std::endl;
    } catch(std::exception &e) {
    std::cerr << "Error opening database: " << "my_db.db" << "\n";
    std::cerr << e.what() << std::endl;
    char *description = "Grocery bill.";
    float money = 122.45;
    Dbt key(&money, sizeof(float));
    Dbt data(description, strlen(description) + 1);
    int ret = db.put(NULL, &key, &data, DB_NOOVERWRITE);
    if (ret == DB_KEYEXIST) {
    db.err(ret, "Put failed because key %f already exists", money);
    try {
    // Close the database
    db.close(0);
    // DbException is not subclassed from std::exception, so
    // need to catch both of these.
    } catch(DbException &e) {
    // Error handling code goes here
    } catch(std::exception &e) {
    // Error handling code goes here
    Db db_1(NULL, 0); // Instantiate the Db object
    u_int32_t cFlags = DB_RDONLY;
    try {
    db_1.open(NULL,"my_db.db",NULL, DB_HASH, cFlags, 0); // Open the
    database
    } catch(DbException &e) {
    std::cerr << "Error opening database: " << "my_db.db" << "\n";
    std::cerr << e.what() << std::endl;
    } catch(std::exception &e) {
    std::cerr << "Error opening database: " << "my_db.db" << "\n";
    std::cerr << e.what() << std::endl;
    char *description_1[13 + 1];
    Dbt key_1, data_1;
    key_1.set_data(&money);
    key_1.set_ulen(sizeof(float));
    data_1.set_data(&description_1);
    data_1.set_ulen(13 + 1);
    data_1.set_flags(DB_DBT_USERMEM);
    db_1.get(NULL, &key_1, &data_1, 0);
    cout << (char *)data_1.get_data() << "\n";
    cout << key_1.get_data() << "\n";
    Basically, I open the database and write a single record then try to
    read that record again from the database.
    What is happening to me is:
    Once I write the record, and read it; it does not print the data
    correctly even the key is not printed correctly. All what I see is
    garbage.
    Can someone points out what is wrong here
    Any help is appreciated.

    Hello,
    Your program requires two changes to print properly.
    1. Db::get retrieves key/data pairs from the database.
    The address and length of the data associated with
    the specified key are returned in the structure to
    which data refers. Hence you'll need:
    key_1.set_data(&money);
    key_1.set_size(sizeof(float));
    data_1.set_data(&description_1);
    data_1.set_ulen(13 + 1);
    data_1.set_flags(DB_DBT_USERMEM);
    db_1.get(NULL, &key_1, &data_1, 0);
    instead of:
    key_1.set_data(&money);
    key_1.set_ulen(sizeof(float));
    data_1.set_data(&description_1);
    data_1.set_ulen(13 + 1);
    data_1.set_flags(DB_DBT_USERMEM);
    db_1.get(NULL, &key_1, &data_1, 0);
    2. To print the float, you'll need:
    cout << *((float*)key_1.get_data()) << "\n";
    instead of:
    cout << key_1.get_data() << "\n";
    With those changes, I get:
    ./ftest9
    Grocery bill.
    122.45
    Which is what I think you want.
    Thanks,
    Sandra

  • Movies in MPEG1 from iPhoto don't appear in iMovie

    Hi - in my iPhoto library I have most of the movies I took with my camera SONY T200 - in format Quick Time Movie. Past few movies (the ones I don't see in iMovie) are in MPEG1 format - which I have no idea how that change happened?
    Can I change the format?
    Is it camera issue or my computer?
    I even tried to import the movie using File/import/movies from iMovie no luck.
    Please help

    From another post...
    The issue is that most MPEG1 clips are not edit-compatible with quicktime, because of how the audio track is multiplexed with the video. But iMovie '09 supports several sony cameras that shoot MPEG1 movies. But only directly from the MPEG1 camera itself. If you've already sucked the movies into iPhoto, you'll have to trick iMovie into thinking its a camera archive, and cross your fingers.
    Try this:
    (1) create a new folder on your hard disk called FakeMPEG1Camera (the name here isn't too important).
    (2) inside that folder, create a folder called DCIM (the name here, and capitol letters, is important)
    (3) inside that folder, place a few of the MPEG1 movies (they need to end with .MPG)
    (4) launch iMovie. Choose File > Import... > Camera Archive...
    (5) navigate to the 'FakeMPEG1Camera' folder. If your clips are importable, the 'DCIM' folder should be grayed out, and the bottom of the window will say 'Camera Archive Detected.'
    (6) click 'Import'. The camera import window will appear, and you can import the clips. iMovie will convert the movie to an edit-compatible format (audio turns into PCM).
    Not every MPEG1 file I've tried works, but many do.
    If you have a Sony camera that shoots MPEG1, it's easiest to import the footage directly into iMovie while it's still on the camera... do that in the future.

  • Values not read from database table.

    Hi experts,
    I have an issue reading values from the database table. In my custom table I have a KUNAG field. The Sold-to partyis a 10 character field. I have saved a record with KUNAG = '0000694012'.
    But when i read the values in a program using KUNAG= '0000694012' no records are read. Kindly help
    Regards,
    Girish

    Hi,
         This field has conversion exit.
         Pass the appropriate value after converting.
    Regards,
    Srini.

  • Communication Channel Problem while reading from database

    Hi,
    I have a JDBC to IDoc scenario.
    The database here is AS400 and i need to read data from AS400 tables and send it to SAP IDocs.
    The communication channel picks up the data from AS400 based on the query and builds the IDocs.
    Suddenly the channel stops working and it doesnt pick up the data from AS400. When we change the name of the Communication Channel, it again starts picking up the data but again for some period.
    It sounds really strange as this is happening only with AS400 database and not it works perfectly when connecting to an SQL Server database.
    Please help me out in resolving this issue.
    Regards
    Kiran.

    Hi Kiran
    Can you check the Notes 717376 ,990892 and try to implement.
    Some tips:
    This error is caused by some optimization in the IBM VM for AS400 which can be disabled through the JIT compiler settings. The following VM setting -Dos400.run.mode=jitc must be set, according to note 717376. Any other value for this setting, as e.g. jitc_de can cause the described problem
    Also, please share the trace, so that, it would help to identify the problem.
    Also try to change the property in Vis Admin
    "cluster-data" -> "Global server configuration" -> "managers" -> "ApplicationThreadManager" -> "MaxThreadCount" ( like 400)
    Regards
    Chilla

  • HT2518 My word files from pc don't appear to have complete figures on word for mac

    Hello all,
    I'm a professor and I'm accepting word files for student assignments.
    When the assignments are made on a pc, when I receive them I get all the figures messed up.
    Same thing happened with my word files from my old PC to my new MacBook Air.
    It is very important for me to get this to work, because all my class notes are written on a pc word.
    They are all in docx format and have been authored with word 2010 I believe for the pc, and are opened by MacOffice 2011 on the mac.
    Note: I don't have any problems with my powerpoints - only the word files.
    Thanks in advance.

    A very good morning John,
    As far as I have understood, there is no problem with ExportPDF. You might need to check whether the fonts in your PDF are embedded or not.
    For this, open the PDF in Reader/Acrobat and go into File>Properties and click on Fonts tab to check for the same.
    If the fonts used in the PDF are not present in the system, then MS Word may not be able to retain the layout of the file.
    Please check.
    Regards,
    Anubha

  • I have one apple ID for my MAC and another used for both my iPhone and IPad.  Purchases from iTunes don't appear on either my iPhone or iPad only only the MAC. How do I sync the two IDs?

    I have one Apple ID for my MAC and iTunes account and another that is used for both my iTunes and iPad.  When I purchased music from iTunes using the Mac ID, the music isn't available on my iTunes or iPad.  Neither lets me change my ID so how do I fix this issue so I can play the music on all three?

    Hello chlanli
    You would need to use one Apple ID for purchases in order to get them across all of your devices and computer. If you want you can use one Apple ID for purchases and the other one to sync personal data. The article below will explain further.
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Regards,
    -Norm G.

  • Local Resource not being read from database

    I created a Customer Resource Provider for my project. 
    This provider is executing properly for Global resource requests (see sample #1 reference below). 
    However, for Local resource references (see Sample #2 below), it is not loading anything.  Can anybody help out or spot what is wrong?
    Sample #1:
    <asp:Label
    ID="lblAmount"
    runat="server"
    Text="<%$
    Resources:TestResource, Total_Amount_is %>"></asp:Label
    >
    Sample #2:
    <asp:TextBox
    ID="txtMoney"
    runat="server"
    meta:resourcekey="txtMoneyResource1"></asp:TextBox>
    Here is the Customer Provider code:
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.Linq;
    using System.Web;
    using System.Web.Compilation;
    using System.Globalization;
    using System.Resources;
    using System.Data;
    using System.Data.SqlClient;
    using System.Data.SqlTypes;
    using System.Text;
    using System.Diagnostics;
    using System.Runtime.CompilerServices;
    namespace Globalization_and_LocalizationV6
    public sealed class SqlResourceProviderFactory : ResourceProviderFactory
    public SqlResourceProviderFactory()
    public override IResourceProvider CreateGlobalResourceProvider(string classKey)
    return new SqlResourceProvider(null, classKey);
    public override IResourceProvider CreateLocalResourceProvider(string virtualPath)
    //virtualPath = System.IO.Path.GetFileName(virtualPath);
    //virtualPath = virtualPath.Replace(HttpContext.Current.Request.ApplicationPath, "");//System.Web.VirtualPathUtility.ToAppRelative(virtualPath)
    virtualPath = virtualPath.Replace(System.Web.VirtualPathUtility.ToAppRelative(virtualPath), "");
    return new SqlResourceProvider(virtualPath, null);
    }//End of Sealed Class called SqlResourceProviderFactory
    internal class SqlResourceProvider : IResourceProvider
    private string _virtualPath;
    private string _className;
    private IDictionary _resourceCache;
    private static object CultureNeutralKey = new object();
    public SqlResourceProvider(string virtualPath, string className)
    _virtualPath = virtualPath;
    _className = className;
    private IDictionary GetResourceCache(string cultureName)
    object cultureKey;
    if (cultureName != null)
    cultureKey = cultureName;
    else
    cultureKey = CultureNeutralKey;
    if (_resourceCache == null)
    _resourceCache = new ListDictionary();
    IDictionary resourceDict = _resourceCache[cultureKey] as IDictionary;
    if (resourceDict == null)
    resourceDict = SqlResourceHelper.GetResources(_virtualPath, _className, cultureName, false, null);
    _resourceCache[cultureKey] = resourceDict;
    return resourceDict;
    object IResourceProvider.GetObject(string resourceKey, CultureInfo culture)
    string cultureName = null;
    if (culture != null)
    cultureName = culture.Name;
    else
    cultureName = CultureInfo.CurrentUICulture.Name;
    object value = GetResourceCache(cultureName)[resourceKey];
    if (value == null)
    // resource is missing for current culture, use default
    SqlResourceHelper.AddResource(resourceKey, _virtualPath, _className, cultureName);
    value = GetResourceCache(null)[resourceKey];//How do you add a new item to the "list" inside this method? Or refresh the list with the updated data?
    if (value == null)
    // the resource is really missing, no default exists
    SqlResourceHelper.AddResource(resourceKey, _virtualPath, _className, string.Empty);
    return value;
    IResourceReader IResourceProvider.ResourceReader
    get
    return new SqlResourceReader(GetResourceCache(null));
    }//End of Sealed Class SqlResourceProvider
    internal sealed class SqlResourceReader : IResourceReader
    private IDictionary _resources;
    public SqlResourceReader(IDictionary resources)
    _resources = resources;
    IDictionaryEnumerator IResourceReader.GetEnumerator()
    return _resources.GetEnumerator();
    void IResourceReader.Close()
    IEnumerator IEnumerable.GetEnumerator()
    return _resources.GetEnumerator();
    void IDisposable.Dispose()
    }//End of Sealed Class SqlResourceReader
    internal static class SqlResourceHelper
    public static IDictionary GetResources(string virtualPath, string className, string cultureName, bool designMode, IServiceProvider serviceProvider)
    SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ASPNETDB"].ToString());
    SqlCommand com = new SqlCommand();
    // Build correct select statement to get resource values
    if (!String.IsNullOrEmpty(virtualPath))
    // Get Local resources
    if (string.IsNullOrEmpty(cultureName))
    // default resource values (no culture defined)
    com.CommandType = CommandType.Text;
    com.CommandText = "select resource_name, resource_value" +
    " from ASPNET_GLOBALIZATION_RESOURCES" +
    " where resource_object = @virtual_path" +
    " and culture_name is null";
    com.Parameters.AddWithValue("@virtual_path", virtualPath);
    else
    com.CommandType = CommandType.Text;
    com.CommandText = "select resource_name, resource_value" +
    " from ASPNET_GLOBALIZATION_RESOURCES " +
    "where resource_object = @virtual_path " +
    "and culture_name = @culture_name ";
    com.Parameters.AddWithValue("@virtual_path", virtualPath);
    com.Parameters.AddWithValue("@culture_name", cultureName);
    else if (!String.IsNullOrEmpty(className))
    // Get Global resources
    string strFinalCultureName = string.Empty;
    if (String.IsNullOrEmpty(cultureName))
    strFinalCultureName = string.Empty;
    else
    strFinalCultureName = cultureName;
    com.CommandType = CommandType.Text;
    com.CommandText = "select resource_name, resource_value " +
    "from ASPNET_GLOBALIZATION_RESOURCES where " +
    "resource_object = @class_name and" +
    " culture_name = @culture_name ";
    com.Parameters.AddWithValue("@class_name", className);
    com.Parameters.AddWithValue("@culture_name", strFinalCultureName);
    //if (string.IsNullOrEmpty(strFinalCultureName))
    // // default resource values (no culture defined)
    // com.CommandType = CommandType.Text;
    // com.CommandText = "select resource_name, resource_value" +
    // " from ASPNET_GLOBALIZATION_RESOURCES " +
    // "where resource_object = @class_name" +
    // " and culture_name is null";
    // com.Parameters.AddWithValue("@class_name", className);
    //else
    // com.CommandType = CommandType.Text;
    // com.CommandText = "select resource_name, resource_value " +
    // "from ASPNET_GLOBALIZATION_RESOURCES where " +
    // "resource_object = @class_name and" +
    // " culture_name = @culture_name ";
    // com.Parameters.AddWithValue("@class_name", className);
    // com.Parameters.AddWithValue("@culture_name", cultureName);
    else
    // Neither virtualPath or className provided,
    // unknown if Local or Global resource
    throw new Exception("SqlResourceHelper.GetResources()" +
    " - virtualPath or className missing from parameters.");
    ListDictionary resources = new ListDictionary();
    try
    con.Open();
    //SqlCommand _com = con.CreateCommand();
    //_com.Connection = con;
    //_com.CommandType = CommandType.Text;
    //_com.CommandText = com.CommandText;
    //_com.Parameters.AddRange(com.Parameters.AddRange(com.Parameters.Cast<System.Data.Common.DbParameter>().ToArray()););
    //foreach (var Parameters in com.Parameters)
    // _com.Parameters.
    com.Connection = con;
    SqlDataReader sdr = com.ExecuteReader(CommandBehavior.CloseConnection);
    while (sdr.Read())
    string rn = sdr.GetString(sdr.GetOrdinal("resource_name"));
    string rv = sdr.GetString(sdr.GetOrdinal("resource_value"));
    resources.Add(rn, rv);
    catch (Exception e)
    throw new Exception(e.Message, e);
    finally
    if (con.State == ConnectionState.Open)
    con.Close();
    return resources;
    }//End of GetResources
    public static void AddResource(string resource_name, string virtualPath, string className, string cultureName)
    string resource_object = "UNKNOWN **ERROR**";
    if (!String.IsNullOrEmpty(virtualPath))
    resource_object = virtualPath;
    else if (!String.IsNullOrEmpty(className))
    resource_object = className;
    string strFinalCultureName = string.Empty;
    if (String.IsNullOrEmpty(cultureName))
    strFinalCultureName = string.Empty;
    else
    strFinalCultureName = cultureName;
    SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ASPNETDB"].ToString());
    SqlCommand com = new SqlCommand();
    StringBuilder sb = new StringBuilder();
    sb.Append("MERGE ASPNET_GLOBALIZATION_RESOURCES as trg " +
    "using (values ('" + resource_object + "', '" + resource_name + "', '" + resource_name + " * DEFAULT * ', '" + strFinalCultureName + "')) " +
    "as source (RESOURCE_OBJECT, RESOURCE_NAME, RESOURCE_VALUE, CULTURE_NAME) " +
    "on " +
    " trg.RESOURCE_OBJECT = '" + resource_object + "' " +
    "and trg.RESOURCE_NAME = '" + resource_name + "' " +
    "and trg.CULTURE_NAME = '" + strFinalCultureName + "' " +
    "when matched then " +
    "update " +
    "set RESOURCE_VALUE = source.RESOURCE_VALUE " +
    "when not matched then " +
    "insert ( RESOURCE_OBJECT, RESOURCE_NAME, RESOURCE_VALUE, CULTURE_NAME) " +
    "values ( source.RESOURCE_OBJECT, source.RESOURCE_NAME, source.RESOURCE_VALUE, source.CULTURE_NAME);");
    com.CommandText = sb.ToString();
    //sb.Append("insert into ASPNET_GLOBALIZATION_RESOURCES " +
    // "(resource_name ,resource_value," +
    // "resource_object,culture_name ) ");
    //sb.Append(" values (@resource_name ,@resource_value," +
    // "@resource_object,@culture_name) ");
    //com.CommandText = sb.ToString();
    //com.Parameters.AddWithValue("@resource_name", resource_name);
    //com.Parameters.AddWithValue("@resource_value", resource_name +
    // " * DEFAULT * " +
    // (String.IsNullOrEmpty(cultureName) ?
    // string.Empty : cultureName));
    //com.Parameters.AddWithValue("@culture_name", (String.IsNullOrEmpty(cultureName) ? SqlString.Null : cultureName));
    //string resource_object = "UNKNOWN **ERROR**";
    //if (!String.IsNullOrEmpty(virtualPath))
    // resource_object = virtualPath;
    //else if (!String.IsNullOrEmpty(className))
    // resource_object = className;
    //com.Parameters.AddWithValue("@resource_object", resource_object);
    try
    com.Connection = con;
    con.Open();
    com.ExecuteNonQuery();
    catch (Exception e)
    throw new Exception(e.ToString());
    finally
    if (con.State == ConnectionState.Open)
    con.Close();
    }//End of AddResource
    public static IDictionary AASearch(List<Dictionary<string, object>> testData, Dictionary<string, object> searchPattern)
    return testData.FirstOrDefault(x => searchPattern.All(x.Contains));
    }//End of Class SqlResourceHelper
    }//End of Namespace Globalization_and_LocalizationV6

    Hi Daniel Rose01,
    Based on your description, this issue is related to the Web development, am I right?
    Since the ASP.NET has his own support forums, so if it is related to the web project, I suggest you post this issue to the ASP.NET forum, and there you would get dedicated support.
    The forum link:
    http://forums.asp.net/
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Emails sent from iPhone don't appear in Sent folder

    This should be an easy one for you guys!
    I have an iPhone 4s running the latest IOS. When I send emails from the phone they do not appear in the Sent folder on the phone. I can't find the setting to change this.
    Thanks!!

    Has the Mobile Me account been set up on your iPhone as POP rather than IMAP? If it has been set up as POP then any message sent will not be mirrored. Your Mobile Me account should also be configured as IMAP on all your devices in order to see those messages in your Sent Items folder.
    The idea of IMAP is to be device independent such that whatever you do is mirrored on all your devices as they each synchronize with Mobile Me. I suppose you could view the Mobile Me "cloud" as being the main repository. If you delete a message from your Inbox via your iPhone, the next time you connect your Mac that message will not appear in the associated Inbox in Mail.
    Does that make sense?
    Chris

  • Work around "cannot copy to disk.....cannot be read from or written to.

    While copying large files(movies or large amounts of music)to the iPod touch the error message" disk cannot be read from or written to" appears. Here is a work around for the failure.
    1. Run the latest version of iTunes and connect the iPod. Perform the following after the failure (allow one failure to occur and repeat this after each occurence) This is only good for one movie or one large grouping of music files. Eject the iPod and allow 30 seconds after the plug is pulled before reattaching the plug to the iPod. Once the summary window appears you are ready to start.
    2. In the movie tab behind the summary remove SYNC Movies check from the box.
    In the Music tab remove the SYNC Music check from the box.
    3. On the summary tab uncheck "manually manage music" in the options section. It will ask if you are sure, choose OK. Click "Apply" in the bottom right corner. Allow the iPod to try to SYNC... a message will appear explaining that there is not enough disk space, choose "OK".
    4. Check "manually manage music" in the options section. Click "Apply" in the bottom right corner.
    5. Drag and drop the selection of music or the movie over to the iPod icon on the left side of the screen under "Devices". The transfer should start and the progress graphic will start in the upper status window.
    ***I have only been able to move/ copy one movie at a time and one large music selection. When attempting the second transfer the error message returns and you have to start the process over. I tryed restoring, updating iTunes, different cables, updating XP, different USB ports, countless system restarts and threatening to smash it if it didn't work. I spoke with APPLE Tech support and they are aware of the problem and should be attempting to correct it. My iPod is @ its default settings. I have had no problems with single music files transfering but I have had it fail on as little as three in a group. Good Luck and I hope this helps.

    Here is some more info on this issue. I've been having the same problem - I've tried disconnecting all other USB devices, making sure to plug into the back-side USB 2.0 port, I even went and bought a PCI card 2-port USB hub and tried that, but could never sync movies or multiple songs (usually less than 50 songs). Today, I was able to transfer 2 movies and a TV show and about 100 songs and the one thing that was different was that I was doing a video conversion in the background with FFMPEG (taking up about 90% CPU), so iTunes only had about 10% CPU while doing the sync.
    Unfortunately, as I started typing this message, a third movie transfer just failed with the "cannot copy to disk..." read/write error. Oh well, just thought I'd get the info out, as this is an exteremely frustrating issue, and hopefully the more info we have we'll eventually be able to figure it out.

Maybe you are looking for

  • Line item display on GL account

    DearAll, my GL is line item display already,then there are transactionts posted in that GL,but still no line item display?and i have to run RFSEPA01. but GL is line item display already,why still need that program to update the relevant table

  • Slow web page loads on Mac, but not for PC

    I use a D-Link wireless router (DI-524) for my PowerBook G4 15" and my roommate's Dell PC. Very recently I seem to get very slow web page loads with some pages not even loading at all. Airport is consistently connected with no drops at all and when I

  • Escaping full screen mode in safari 5

    press escape and nothing happens. is there something i'm missing?

  • 10.2.0.3 is this Availabe/ or not or 10.2.0.4

    Hi, I am looking for 10.2.0.3 patch set .... want to save some time for Day light saving patches ... Can any one suggest me from where I can download this and I know there were bugs in this .. SO can I believe now its bug free also or should I wait f

  • Pass variable value from one dashboard to another dashboard

    Hello, I have one main dashboard which have "year" prompt with drop down and variaous links & also some reports. And we have same year prompt on another dashboards only difference is, this prompt is editable not drop down. The requirement is, when I