Click here to Skip to main content
15,922,427 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is it called when your class has a root collection and how do you do it in C#? Pin
Paul Conrad27-Jun-08 16:22
professionalPaul Conrad27-Jun-08 16:22 
GeneralRe: What is it called when your class has a root collection and how do you do it in C#? Pin
qmuffs27-Jun-08 16:30
qmuffs27-Jun-08 16:30 
AnswerRe: What is it called when your class has a root collection and how do you do it in C#? Pin
Karthik Kalyanasundaram27-Jun-08 16:37
Karthik Kalyanasundaram27-Jun-08 16:37 
GeneralRe: What is it called when your class has a root collection and how do you do it in C#? Pin
qmuffs27-Jun-08 16:41
qmuffs27-Jun-08 16:41 
QuestionADO.net locks out SQL2000 user account under load Pin
Mr Jen Withers27-Jun-08 11:11
Mr Jen Withers27-Jun-08 11:11 
AnswerRe: ADO.net locks out SQL2000 user account under load Pin
Mark Churchill28-Jun-08 6:04
Mark Churchill28-Jun-08 6:04 
GeneralRe: ADO.net locks out SQL2000 user account under load Pin
Mr Jen Withers28-Jun-08 6:36
Mr Jen Withers28-Jun-08 6:36 
QuestionProblems withValidation Application Block and config files Pin
novicedotnetter27-Jun-08 10:10
novicedotnetter27-Jun-08 10:10 
Hi,
I am new to C#, tried working with Validation Application blocks using the .config file approach and have run into some issues.I have created a solution file with 2 projects, 1 project has a form and am passing a value to the other project ( basically a class library )which has the app.config file and the class which contains the properties for which i have the get and set values.
Project 1

using ClassLibrary1;
using Microsoft.Practices.EnterpriseLibrary.Validation;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace Trial
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

Class1 cw = new Class1();
cw.iNum = 1110;

ValidationResults results = Validation.ValidateFromConfiguration(cw, "Default");
if (!results.IsValid)
MessageBox.Show("error");

}
}
}


Project 2 has Class1.cs and the config file
Class1.cs
public class Class1
{
public int iNum;
public Class1()
{
}
#region Properties
public int Num
{
get { return iNum; }
set { iNum = value; }
}
#endregion
}


app.config
<configuration>
<configsections>
<section name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.0.0.0, Culture=neutral" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.0.0.0, Culture=neutral" />
</configsections>
<validation>
<type assemblyname="ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
name="ClassLibrary1.Class1"&gt;
<ruleset name="Default">
<properties>
<property name="Num">
<validator lowerbound="2" lowerboundtype="Inclusive" upperbound="100">
upperBoundType="Inclusive" negated="false" messageTemplate=""
messageTemplateResourceName="" messageTemplateResourceType=""
tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RangeValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.0.0.0, Culture=neutral"
name="Range Validator" /&gt;
</validator></property>
</properties>
</ruleset>
</type>
</validation>
</configuration>

my problem is that i am passing a value of 1110, but the range value is from 2 till 100, yet the validation is succeeding. Am i missing out on any details
QuestionSlow selection in ListView Pin
Xmen Real 27-Jun-08 8:06
professional Xmen Real 27-Jun-08 8:06 
AnswerRe: Slow selection in ListView Pin
J$27-Jun-08 10:04
J$27-Jun-08 10:04 
GeneralRe: Slow selection in ListView Pin
Xmen Real 27-Jun-08 12:36
professional Xmen Real 27-Jun-08 12:36 
GeneralRe: Slow selection in ListView Pin
Leblanc Meneses27-Jun-08 15:17
Leblanc Meneses27-Jun-08 15:17 
GeneralRe: Slow selection in ListView Pin
Xmen Real 27-Jun-08 15:28
professional Xmen Real 27-Jun-08 15:28 
QuestionInteresting Question---Related to Images Pin
paresh_sarjani27-Jun-08 7:03
paresh_sarjani27-Jun-08 7:03 
AnswerRe: Interesting Question---Related to Images Pin
Xmen Real 27-Jun-08 8:07
professional Xmen Real 27-Jun-08 8:07 
GeneralRe: Interesting Question---Related to Images Pin
paresh_sarjani28-Jun-08 7:13
paresh_sarjani28-Jun-08 7:13 
QuestionRe: Interesting Question---Related to Images Pin
CPallini27-Jun-08 10:33
mveCPallini27-Jun-08 10:33 
AnswerRe: Interesting Question---Related to Images Pin
Pete O'Hanlon27-Jun-08 10:46
mvePete O'Hanlon27-Jun-08 10:46 
GeneralRe: Interesting Question---Related to Images Pin
Luc Pattyn27-Jun-08 11:53
sitebuilderLuc Pattyn27-Jun-08 11:53 
AnswerRe: Interesting Question---Related to Images Pin
Christian Graus27-Jun-08 13:00
protectorChristian Graus27-Jun-08 13:00 
QuestionGraphics question (Newbie) Pin
kruegersck27-Jun-08 5:24
kruegersck27-Jun-08 5:24 
AnswerRe: Graphics question (Newbie) Pin
led mike27-Jun-08 5:54
led mike27-Jun-08 5:54 
AnswerRe: Graphics question (Newbie) Pin
Rao Rafique27-Jun-08 22:48
Rao Rafique27-Jun-08 22:48 
QuestionHow to dynamically Remove all data in the "Web.SiteMap" file using c# aspx 2.0. Pin
bruze27-Jun-08 5:06
bruze27-Jun-08 5:06 
QuestionLooking for advanced DirectShow (c#) coder Pin
etherny27-Jun-08 4:56
etherny27-Jun-08 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.