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
Hussam Fattahi
Posts
-
BindingSource.Filter expression as not equal!! -
BindingSource.Filter expression as not equal!!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
-
BindingSource.Filter expression as not equal!!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
-
where to put try catch block!thanks for clarification
-
where to put try catch block!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
-
where to put try catch block!thanks, your help is greetly appreciated
-
where to put try catch block!thanks for reply
-
where to put try catch block!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
-
where to put try catch block!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
-
where to put try catch block!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
-
A List Of Values component or user control!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
-
datetimepicker format for entire application!! [modified]what do you mean by extension method?
-
datetimepicker format for entire application!! [modified]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
-
datetimepicker format for entire application!! [modified]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
-
datetimepicker format for entire application!! [modified]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
-
types formats in app.configafter 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
-
listbox selectedvaluechanged event fires programmaticlly !!! [modified]didn't work when applied on form construcor so i tried this
private void Form1_Load(object sender, EventArgs e)
{
this.stillInitializing = true; //NEW CODEunitMeasureCollection.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 :)
-
listbox selectedvaluechanged event fires programmaticlly !!! [modified]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
-
error message when adding new sqldatabase item!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
-
Serializable attribute!!! [modified]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