Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

GDavy

@GDavy
About
Posts
329
Topics
88
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem getting data from a stored procedure (Oracle)
    G GDavy

    On the Oracle DB there's a stored proc defined like:

    PROCEDURE pGetHashes ( iFrom IN NUMBER, iTo IN NUMBER, sHash1 OUT CHAR, sHash2 OUT CHAR );

    When I call this procedure from within my app, I only get a value for the sHash2 parameter. The value of the sHash1 parameter is always null. (Running the same stored proc from sqldeveloper gives a result for both hash values.) Underneath I have added the code which I use to call the stored proc. Does anybody see anything I might have done wrong?

                int iFrom = 0;
                int iTo = 1000;
                using (IDbCommand command = dbConnection.CreateCommand())
                {
                    OracleCommand orclCommand = command as OracleCommand;
                    orclCommand.CommandText = "pGetHashes";
                    orclCommand.CommandType = CommandType.StoredProcedure;
                    
                    orclCommand.Parameters.Clear();
                    orclCommand.Parameters.Add("iFrom", OracleDbType.Int32, iFrom, ParameterDirection.Input);
                    orclCommand.Parameters.Add("iTo", OracleDbType.Int32, iTo, ParameterDirection.Input);
    
                    OracleParameter orclParam = new OracleParameter("sHash1", OracleDbType.Char, 100);
                    orclParam.Direction = ParameterDirection.Output;
                    orclCommand.Parameters.Add(orclParam);
                    orclParam = new OracleParameter("sHash2", OracleDbType.Char, 100);
                    orclParam.Direction = ParameterDirection.Output;
                    orclCommand.Parameters.Add(orclParam);
    
                    orclCommand.BindByName = true;
    
                    orclCommand.ExecuteNonQuery();
    
                    // after this the orclCommand.Parameters\["sHash1"\].Value is always null. 
                    // the orclCommand.Parameters\["sHash2"\].Value has the correct value.
                }
    

    For extra documentation. Running the following PLSQL from within sqldeveloper results in both a value for Hash1 and Hash2:

    SET SERVEROUTPUT ON;
    DECLARE
    sHash1 CHAR(67);
    sHash2 CHAR(67);
    nFrom NUMBER := 0;
    nTo NUMBER := 1000;
    BEGIN

    pGetHashes( nFrom, nTo, sHash1, sHash2 );

    dbms_output.put_line('Hash1: '|| sHash1);
    dbms_output.put_line('Hash2: '|| sHash2);
    END;

    Thanks for any light you can shed on this problem.

    C# database oracle cryptography help question

  • Blocking threads - growing memory
    G GDavy

    Hello, I have an annoying issue where I could use some advice. I created a small windows service which uses at standard time-intervals different COM components. Every time the COM components are instantiated in their own thread, the required methods are invoked and the COM components are subsequently released and their threads end, the main thread can then evaluate the result of each COM component's action. For some COM components(third party) a problem occurs from time to time and the instantiation of the COM object blocks the thread. Even calling an Abort on these threads is not possible because doing that causes the main-thread to block. The COM components are simply instantiated using: System.Activator.CreateInstance(comType); //here it blocks when it goes wrong (not always) The comType is gotten using: Type comType = Type.GetTypeFromProgID(sComName); //sComName is the name of the COM component If this blocking happens frequently, the memory of the process increases steadily due to all the blocked threads that I can't stop. So what I need is an ability to use the COM components, and still be able to clean up the threads in case such a block occurs. Does anyone have any ideas how I could accomplish that? Regards, Davy

    C# help com performance question

  • Porting from CE4.x to CE6
    G GDavy

    Thanks for the reply! I have tried this now, but now I stumble on a new problem. The external library seems to require being linked to the mfcce400.lib, because if I put the mfcce400.lib to the Ignore-list I get a heap of unresolved external symbol errors inside that library. error LNK2001: unresolved external symbol "public: __cdecl CString::CString(void)" (??0CString@@QAA@XZ) comCtrl.lib error LNK2019: unresolved external symbol "public: __cdecl CString::CString(void)" (??0CString@@QAA@XZ) referenced in function "public: __cdecl CTTP::CTTP(bool)" (??0CTTP@@QAA@_N@Z) comCtrl.lib etc... I'm beginning to think that I probably won't be able to use that external library in CE6... And it's actually quite important :( Regards, Davy

    Mobile question help

  • Porting from CE4.x to CE6
    G GDavy

    I am porting an application from CE 4.x to CE 6.0 It all went quite smoothly, but there is one problem. The application uses an external library build for CE4.0, so when the compiler tries to link to that library I initialy got the error: fatal error LNK1104: cannot open file 'mfcs42.lib' What I did is I added the directory with these CE4.0 libraries to the directories the compiler should search for libs and build again, which got me to the next problem: error LNK2005: "public: void __cdecl CRect::InflateRect(int,int,int,int)" (?InflateRect@CRect@@QAAXHHHH@Z) already defined in MFCCE400.lib(mfcce400.dll) atlsd.lib error LNK2005: "public: void __cdecl CRect::DeflateRect(int,int,int,int)" (?DeflateRect@CRect@@QAAXHHHH@Z) already defined in MFCCE400.lib(mfcce400.dll) atlsd.lib fatal error LNK1169: one or more multiply defined symbols found SDK_TR4_CE6_MAXIE_2008Q1 The InflateRect and DeflateRect functions apparantly are both defined in the MFCE400.lib(CE4) and in the atlsd.lib(CE6). Both these functions are called in my application which builds fine without that external library, so my application does not need that CE4 library. From the moment I add the code that uses that external library I get into this problem. So my question is: How can I link to that external library without getting in this trouble? Or how can I make the compiler only link the external lib to the CE4 libs and not use these libs for my application? Thanks for any insight you might provide. Regards, Davy

    Mobile question help

  • House lifting
    G GDavy

    I hope your area doesn't have earthquakes from time to time... I bet even a small one could drop the house back to ground level, including the roof...

    The Lounge css com

  • Sign Language
    G GDavy

    "Send SMS to 1566 mentioning iSeeJesus and your name to be liable for a front row seat. Winners will be mentioned Saturday after supper!"

    The Lounge html

  • Sign Language
    G GDavy

    Hmmm, 10:30 seems a bit too specific... I always figured Jezus to be the type of person without a tight schedule. So I imagine he'ld make arrangements of the type like: 'in the morning' or 'at dusk' or 'before supper'. Making appointments at 10:30 just doesn't seem like him... So I think this is likely a hoax ;P.

    The Lounge html

  • Unable to print micron character µ (mu) in japanese OS
    G GDavy

    Don't use ANSI strings, use UNICODE strings, ANSI strings will use the local Codepage for character conversions wich causes your problem.

    C / C++ / MFC c++ help question

  • System.DBNull returned for whitespace strings
    G GDavy

    Ok, this was a really stupid mistake of mine. Had written a PL/SQL block that replaced for certain rows in particular cases a null value with a singe white space string. BUT here comes the stupidity : forgot to commit... Was running my .NET app: I got DBNull, was double checking on the session that had run the PL/SQL block which was returning ofcourse the single character string. So committed the changes now and runs like a charm. X|

    C# database oracle help question

  • NotifyPropertyChanged and ReadValue() not working
    G GDavy

    bizarre situation indeed... I know I'm pointing out the obvious here, but anyways you never know where you could have overlooked something. Are you certain the NotifyPropertyChanged event is called with the correct Property name perhaps there is a casing error?

    public int MyProp
    {
    get{return _myProp;}
    set
    {
    _myProp = MyProp value; //sorry was too fast posting here :)
    NotifyPropertyChanged("MyProp"); //ok
    NotifyPropertyChanged("myProp"); // not ok... no error but propertychanged will not be forwarded to controls...
    }
    }
    #region INotifyPropertyChanged Members

        protected void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
                handler(this, new PropertyChangedEventArgs(propertyName));
        }
        #endregion
    
    C# visual-studio help question

  • NotifyPropertyChanged and ReadValue() not working
    G GDavy

    Hmm.... Are you certain the Facility object is not re-instantiated somewhere after the binding. That could explain this behaviour.

    C# visual-studio help question

  • System.DBNull returned for whitespace strings
    G GDavy

    I am using OracleDataReader to read data from our DB (oracle) The annoying thing is that in a certain column I have a string with a single white-space, however the datareader seems to convert this to a System.DBNull value, which is incorrect. Does anyone know if there is a setting on the OracleDataReader or perhaps the OracleConnection objects to prevent the conversion from white-space strings to DBNull? Thanks for any help you can provide, Davy

    C# database oracle help question

  • DataBinding issue
    G GDavy

    Thanks! It works like a charm now... I had set the databinding via the Visual Studio GUI using a BindingSource. Apparantly it doesn't set the parameters exactly the same way. Setting the binding myself the way you showed made it work. Greetings, Davy

    C# help wpf wcf tutorial

  • DataBinding issue
    G GDavy

    Hello people, I have the following problem. I have a class with a property like in the below example:

    class myClass:INotifyPropertyChanged
    {
    private string theProp;

    public string TheProp
    {
    get{ return theProp; }
    set
    {
    if( string.IsNullOrEmpty(value) )
    theProp = "Another Value";
    else
    theProp = value;
    NotifyPropertyChanged("TheProp");
    }
    }
    /// And a lot of other stuff
    }

    So in case an empty or null is set I set the internal value of the property to a default string. The object is doing this just fine. But the problem I have is with a textBox that is bound to this property. When I delete the text in the textbox, the textbox does not represent the different value. Probably I'm doing something wrong with the binding, it seems like a common way to set a different value, so I suppose there must be a way to make this work. thanks for any help you might provide. Davy

    C# help wpf wcf tutorial

  • Set maximum available width for Stackpanel
    G GDavy

    I don't do xaml that often, so some (probably) basic stuff bites me in the ass now and then. The small problem I have now is that I can't seem to get a stackpanel take the correct size. This is basicly how the form looks like:

      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
    
       .....
       Here a bunch of controls are added and then come the stackpanels
    
       <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
         And again some controls in the stackpanel
       </StackPanel>
       .....
    

    What happens is that the stackpanel takes exactly the size needed to fit the controls it has in it, which does not look as nice. I would like that the stackpanel uses the full column-width of the grid. I tried binding the width of the stackpanel to the column, widht like this:

        First name the column where the stackpanel is in
        <Grid.ColumnDefinitions>
          ....
          <ColumnDefinition **x:Name="BindColumn"** Width="Auto"/>
          ....
        &lt;/Grid.ColumnDefinitions&gt;
    
        Then bind to the width like:
        <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" **Width="{Binding ElementName=BindColumn, Path=Width}"**\>
    

    This doesn't work. It doesn't seem like I want something that should be difficult to make it work, so I'm probably offtrack here with my way of thinking. Thanks to anyone if they can put me on the right track again. Greets, Davy

    WCF and WF wpf css wcf help

  • Start the Week type CCC
    G GDavy

    batting: From my limited knowledge of batting games I seem to recall all of them having bases in them.. So I assume you bat from a base position Wine container= flute (the glasses from which you drink champagne, which is a kind of wine) bassflute I know it's 9 letters not 8, but since I presume I won't find the actual solution I thought I came close here ;)

    The Lounge docker

  • Slightly early CCC
    G GDavy

    second shot.... confined fish=net (mind got stuck on this meaning) old = ac or bc security device = lock the other hint... pointed books=braille, but we will abbreviate this to 'net' for our sake ;) old = ac or bc german charm=lock (at least that's what I would say to a German if I want to say charm) so my second best guess is netaclock It fits both hints and I have no clue if it is a real word :laugh:

    The Lounge security

  • Slightly early CCC
    G GDavy

    netkeeper confined fish = in an net old security device = keeper (guard)

    The Lounge security

  • Initial width of control with Binding on Width
    G GDavy

    Thanks for the suggestion, this sets the initial width correctly. Regards, Davy

    WCF and WF wpf help wcf question

  • Initial width of control with Binding on Width
    G GDavy

    I have a form in which I create some controls dynamically and bind the width of some text controls to the width of other controls at the creation time of the form. The problem is that when the Window appears initially these text controls do not have a correct width. From the moment I resize the controls of which the width is bound to the text boxes, the text boxes take the correct size. Since these controls are created dynamically I create the binding in code and not in xaml, like this

                Binding widthBound = new Binding();
                widthBound.Source = referenceControl;
                widthBound.Path = new PropertyPath("Width");
                widthBound.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
    

    And I set the binding on the textblock like this:

                txtBlock.SetBinding(TextBlock.WidthProperty, widthBound);
    

    The referenceControl takes an initial width depending on the content of the control. So I presume that this initial width is calculated during creation and the PropertyChanged is not triggered then. Is there a trick to get this Width of the textboxes correct anyway? Thanks for any help, Davy

    WCF and WF wpf help wcf question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups