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
H

Hussam Fattahi

@Hussam Fattahi
About
Posts
56
Topics
28
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • BindingSource.Filter expression as not equal!!
    H Hussam Fattahi

    sorry, my Bad i meant AND by using NOT do you mean i can write it like this NOT( FieldCode = 1 AND FieldCode = 5 ....) or like this NOT( FieldCode IN(1,5,...)) thanks again

    C# css wpf wcf question

  • BindingSource.Filter expression as not equal!!
    H Hussam Fattahi

    hi luc, thanks for replay i do read the full page in MSDN before posting here what i want to do is the following i have a list of type int named execludedFields which holds the codes for unwanted records i want to loop through the collection to build a filter like this "FieldCode != 1 OR FieldCode != 5 .... and so on" i couldn't figure out how to do it because there is no negative operator of course i can do it the other way around by getting a list called watntedFields but that requires a lot coding more than using the execludedFields approach so I'm asking if there is a way to build a filter that do that using the Filter property

    C# css wpf wcf question

  • BindingSource.Filter expression as not equal!!
    H Hussam Fattahi

    Hi I want to filter a bound grid through binding source filter property. but i couldn't write a filter like this "DocumentID != 1"; it throws an exception saying ! not acceptable. how can i achive this

    C# css wpf wcf question

  • where to put try catch block!
    H Hussam Fattahi

    thanks for clarification

    C# database question

  • where to put try catch block!
    H Hussam Fattahi

    i thought exception hiding is doing like this

    catch (Exception ex)
    {

    }

    and i'm not sure what specific exception will happen so i used the general exception thanks

    C# database question

  • where to put try catch block!
    H Hussam Fattahi

    thanks, your help is greetly appreciated

    C# database question

  • where to put try catch block!
    H Hussam Fattahi

    thanks for reply

    C# database question

  • where to put try catch block!
    H Hussam Fattahi

    DaveyM69 wrote:

    If the exception is of no consequence to external code

    my english is not very good, i don't get what you mean by this by the way i'm using llblgen

    C# database question

  • where to put try catch block!
    H Hussam Fattahi

    the problem is that many exceptions are expected and returning a bool value is not enought to descripe what error has been caught, so i need to handle in the function that calls save

    C# database question

  • where to put try catch block!
    H Hussam Fattahi

    hi a function called Save() saves user input to database should i write try catch block like this

    private void Save()
    {
    try
    {
    //My code goes here
    }
    catch (SqlException sqlEx)
    {
    MessageBox.Show(sqlEx.Message);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
    }

    or should i write it like this in the function or event handler that calls Save();

    try
    {
    Save();
    }
    catch (SqlException sqlEx)
    {
    MessageBox.Show(sqlEx.Message);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }

    and what is the difference, if there was a difference and which is a better coding practice thanks

    C# database question

  • A List Of Values component or user control!
    H Hussam Fattahi

    oracle uses a list of values component i searched internet but i couldn't find anything similar in C# by the same name is there other name for this component any links or resources would be helpful thanks in advance excuse my bad language

    C# csharp oracle

  • datetimepicker format for entire application!! [modified]
    H Hussam Fattahi

    what do you mean by extension method?

    C# regex

  • datetimepicker format for entire application!! [modified]
    H Hussam Fattahi

    John Simmons / outlaw programmer wrote:

    I suspect that you can get away with setting the control when the form is constructed, and then forget about it.

    yes, i can do that, but then i have to put it in each form in my application. i'm looking if there is a way to do it globaly do it in one place and this is it for the whole application thanks anyway

    C# regex

  • datetimepicker format for entire application!! [modified]
    H Hussam Fattahi

    thanks for reply first: as i mentioned in my question, i was able to change the pattern of the format, not the format property for option 2: it does not work for me, because i am actually showing the date in the datetimepicker not into textbox control, so i'm not using DateTime.ToString() for option 3: do you mean that i have to access the static cultureinfo object every time i need to to display the date in datetimepicker or do i have to change the format manually in each datetimepicker contro on my form based on the cultureInfi properties excuse my bad english thanks for the reply again

    C# regex

  • datetimepicker format for entire application!! [modified]
    H Hussam Fattahi

    after adding a key in app.config for format i tried this, in the Main method

    CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
    culture.DateTimeFormat.ShortDatePattern = "dd-MMM-yyyy";
    culture.DateTimeFormat.LongTimePattern = "";
    Thread.CurrentThread.CurrentCulture = culture;

    i was able to change pattern for short date, but what i want is that the datetimepicker format's property defaults to what i set in config file. like if i set the datetime format in config file to Long the rule will applay to entire application. do i have to check and change manually for each control. thanks

    modified on Sunday, December 27, 2009 2:46 AM

    C# regex

  • types formats in app.config
    H Hussam Fattahi

    after serching in msdn and internt i couldn't find any predefined section in application config file to save the types formats (( shor or long for dates etc..)) is there such an element or cofiguration section to save this information or do i have to create a custom configuration section for it thanks

    C# workspace

  • listbox selectedvaluechanged event fires programmaticlly !!! [modified]
    H Hussam Fattahi

    didn't work when applied on form construcor so i tried this

    private void Form1_Load(object sender, EventArgs e)
    {
    this.stillInitializing = true; //NEW CODE

            unitMeasureCollection.GetMulti(null);
            vendorCollection.GetMulti(null);
            shipMethodCollection.GetMulti(null);
            purchaseOrderDetailCollection.GetMulti(null);
    
            /\*PredicateExpression filter = new PredicateExpression(UnitMeasureFields.UnitMeasureCode == "BOX");
            unitMeasureCollection1.GetMulti(filter);
            \*/
    
            comboBoxUnitMeasure.DataSource = unitMeasureCollection;
            comboBoxUnitMeasure.ValueMember = "UnitMeasureCode";
    
            listBoxVendor.DataSource = vendorCollection;
            listBoxVendor.DisplayMember = "Name";
            listBoxVendor.ValueMember = "VendorID";
    
            listBoxShipMethod.DataSource = shipMethodCollection;
            listBoxShipMethod.DisplayMember = "Name";
            listBoxShipMethod.ValueMember = "ShipMethodID";
    
            dataGridView1.DataSource = purchaseOrderDetailCollection;
    
            PopulateCategoriesAndSubCategories();
    
            //To clear textboxes affected by lisbox event that fired automatically
            ClearTextBoxes();
            DisableButtons();
    
            this.stillInitializing = false;                                       //NEW CODE
        }
    

    and it worked just fine thanks, Henry Minute :)

    C# database tutorial question

  • listbox selectedvaluechanged event fires programmaticlly !!! [modified]
    H Hussam Fattahi

    I'm populating a listbox using it's DataSource property in form's load event what happens is that the selectedValueChanged event or selectedIndexChanged fires twice when starting the form how can i prevent such behaviour i want the event to fire only when user change listbox by mouse there is an event straight for this(SelectionChangeCommitted), but it's availabe only on combbox control i need to use listbox for htis. how can i achive such behaviour secondly: when i first run the form, the selectedValueChanged event always fired once again selecting the firs index in the listbox how to stop this also i want to run the form without any event being fired unless the user change the value manually thanks

    modified on Tuesday, October 27, 2009 7:04 AM

    C# database tutorial question

  • error message when adding new sqldatabase item!
    H Hussam Fattahi

    When i try to add a SQL Database item from "Add New Item" menu to my ASP.NET project i always get this error message an error occurred while processing the local data file: key not valid for use in specified state. Help, thanks

    Database database help csharp asp-net

  • Serializable attribute!!! [modified]
    H Hussam Fattahi

    Is Serializable Attribute's behavior inheritable? i have two classes classA, classB. classA have Serializable attribute applied to it. classB inherits classA i want to serialize classB. do i have to apply serializable attribute to classB as well, or inherting from classA would be enough. thanks.

    modified on Sunday, September 7, 2008 9:23 AM

    C# 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