|
There are some measures for preventing injection of malicious data - HTML tags and scripts are considered dangerous input. If you get a message like A potentially dangerous value was detected from the client and you are really sure you want to save that text, you may override the validation behavior of ASP.Net in the individual page by
<%@ Page Language="c#" ValidateRequest="false" ...
and in web.config
<httpRuntime requestValidationMode="2.0" />
|
|
|
|
|
If you're using .NET 4.5, it would be better to set the ValidateRequestMode property[^] on the specific control(s) which should be allowed to contain HTML.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All!
I Have a Table1 Like This :
---------------------------
myID | myItem | IdCountry
2-----Japan------1
4-----US---------2
5-----UK---------1
7-----Canada----2
---------------------------
Now ,I fill combobox1 from with this Code :
string strQuery= @"SELECT myID,myItem FROM Table1 WHERE IdCountry=1";
SqlConnection cnnCbx = new SqlConnection(cnnClass.CnnString);
cnnCbx.Open();
SqlDataAdapter daCbx = new SqlDataAdapter(strCbxQueryItems, cnnCbx);
DataTable dtCbx = new DataTable();
daCbx.Fill(dtCbx);
cbxKindOfItems.ValueMember = "myID";
cbxKindOfItems.DisplayMember = "myItem";
cbxKindOfItems.DataSource = dtCbx.DefaultView;
Ho Can I get myID Value When I select an Item from Combobox ?
|
|
|
|
|
Try:
var myID = cbxKindOfItems.SelectedValue;
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
You can get the value of myID by calling the
SelectedValue property on the
ComboBox control.
e.g:
MessageBox.Show(cbxKindOfItems.SelectedValue.ToString());
To show the ValueMember of the SelectedItem.
Hope it helps..
|
|
|
|
|
Hello All , i'm stucked in C# , to get the percentile from array of column values .please check the below code and let me know how can i pass the arguments to the method .
public double Percentile(double[] sequence, double excelPercentile)
{
Array.Sort(sequence);
int N = sequence.Length;
double n = (N - 1) * excelPercentile + 1;
if (n == 1d) return sequence[0];
else if (n == N) return sequence[N - 1];
else
{
int k = (int)n;
double d = n - k;
return sequence[k - 1] + d * (sequence[k] - sequence[k - 1]);
}
}
and i have the array of data - and also k value as 0.95.
percentile(myarray , K);
the above method sending me error . please let me know , what is my mistake.
modified 8-Aug-16 10:57am.
|
|
|
|
|
Mallesh Shantagiri wrote: what is my mistake
For starters, you posted in wrong forum. Try using C# forum or Q & A section.
"You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this goddamn clusterfuck.", BruceN[ ^]
|
|
|
|
|
You should head over to the Q&A[^] and ask the question there, as the Lounge is the wrong place for programming questions.
|
|
|
|
|
You're gonna get yelled at for not reading the red text at the top of this page!
Get me coffee and no one gets hurt!
|
|
|
|
|
Cornelius Henning wrote: You're gonna get yelled at I think the 3rd person telling them they did wrong fulfills this prophecy.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
So true. 
|
|
|
|
|
Similar to calculating the percentile of respondents will not answer the question because it doesn't belong here.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Mallesh, I applaud you for posting a sample of your code. Thank you for that. When you repost your question, what would really help everyone is if you provided details of what the error is that you are seeing; it's a lot easier to work out what a problem is, if you can isolate the error.
This space for rent
|
|
|
|
|
Off the top of my head, you are trying to do math with an int and a double data type. Without testing your code, I would say this might be a problem. convert the int to double or the double to int, then do the math.
Also, as many, many others have mentioned, you are "technically" not supposed to ask "programming" questions here in the Lounge.
-- Thanks.
|
|
|
|
|
Accidentally i posted here , Sorry for that.
Thanks
|
|
|
|
|
Mallesh Shantagiri wrote: what is my mistake.
Breathing the same air that we do...
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
A little harsh, I think.
He is asking a legitimate question I believe.
|
|
|
|
|
I guess JSOP's message was posted before this thread was moved from The Lounge.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Correct.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You know in your heart of hearts that for me, this is not harsh at all.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
|
I wanted to create a program for controlling stepper motors using c # using serial port how to
|
|
|
|