Sunday, February 1, 2015

Text Changed Event conflicting with Selected Index Changed Event

Your problem is that you are using the textboxes to perform two separate functions, displaying the current selection and editing. This sort of approach is asking for just the kind of trouble that you are experiencing. Experience tells me that if you persevere for long enough, you will eventually get it to work, but the result will be a confusing tangle of setting and unsetting flags based on whether the textboxes have gained or lost the focus (and hence the text change is due to the user typing in the box or not), and you won't have any way for the user to cancel their changes if they make a mistake.


I suggest adding an Edit button which explicitly sets the textboxes into edit mode, and Apply and Cancel buttons to confirm or discard the changes. Or possibly even better, write a new form just for editing that is invoked when the Edit button is pressed.

Restricted property value to list

How can I create a property in C# whose value can be selected only from list of predefined value?


like dir attribute in asp.net which can be selected from rtl, ltr, auto.


Restricted property value to list

If you want to be able to set the value of your property to only a set of predefined values at compile-time you could specify the type of the property as an enum:



public enum MyType
{
ValidValueOne,
ValidValueTwo
}

public class YourClass
{
public MyType MyProperty { get; set; }
}





If you want to restrict the values at run-time you could implement some logic in the setter of the property, e.g:



public class YourClass
{

private string _s;
public string MyProperty
{
get { return _s; }
set
{
if (value != "validvalue1" && value != "valuedvalue2")
throw new InvalidOperationException("invalid value");

_s = value;
}
}
}



Please remember to mark helpful posts as answer and/or helpful.

Restricted property value to list

MyProperty cannot return a string if you want to be able to restrict the values it can be set to a compile time, it must return a MyType.


You can use the Enum.TryParse method to convert a string into an enum value: http://ift.tt/1kno09O


Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.


Extending TableAdapters

Rather than asking for a complete solution, it would be better if you can post the code you wrote to convert the VB here along with a detailed description of syntax and/or run time errors, so readers can see what you are trying to do.


Looking at the article you cited, it appears that amount of code is not overwhelming, so showing us what you tried is more likely to result in helpful suggestions.


Saturday, January 31, 2015

logic implementation in sql

Hi Dre,


Does Patrick's sample query helpful for you on this issue? If the issue persists, please post the detail information about your issue, so that we can make further analysis.


Regards,




Charlie Liao

TechNet Community Support



RSReportServerNotActivated error



Dilip Patil..