15,900,461 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by charmyvora (Top 12 by date)
charmyvora
2-Sep-16 11:51am
View
That is not asp.net problem. You will have to add parameter and its value as required by stored procedure.
Ex:
command.Parameters.Add("@UserInfo", SqlDbType.int);
What are other errors??
I hope you changed values in <> whatever is inside <> is sample data. Remove <> and replace with your requirement.
charmyvora
30-Aug-16 2:06am
View
Then it seems something wrong. Just paste your label code of aspx page and code behind
charmyvora
29-Aug-16 7:07am
View
Please Comment on answer. Do not add as solution.
You are using normal label.
Asp label is used as:
<asp:Label>
Anyways have runat attribute and your code will work
charmyvora
27-Aug-16 12:14pm
View
I just mentioned to use simple array. let me know if you face problem in that
charmyvora
10-Aug-16 7:10am
View
Thanks. Please rate my solution when you see it
charmyvora
10-Aug-16 7:09am
View
Your reg expression is wrong. Kindly copy paste my code in solution below
charmyvora
10-Aug-16 7:08am
View
z!! I do not think my code do that. please recheck.
charmyvora
10-Aug-16 7:06am
View
I have posted as a separate solution. Please comment there
charmyvora
10-Aug-16 7:05am
View
Do not do on key down. see above comment
charmyvora
10-Aug-16 7:04am
View
Yes... Here is perfect code for you. Will avoid your exception as well
private void textBox1_TextChanged(object sender, EventArgs e)
{
System.Text.RegularExpressions.Regex myRegex = new System.Text.RegularExpressions.Regex("^[a-fA-F0-9]+$");
string text = textBox1.Text;
bool isHex = myRegex.IsMatch(text);
if (!isHex && text.Length > 0)
{
textBox1.Text = text.Substring(0, text.Length - 1);
textBox1.SelectionStart = textBox1.Text.Length;
}
}
charmyvora
10-Aug-16 6:55am
View
This is simple logic, just have if on text change and skip whole logic when blank.
charmyvora
10-Aug-16 6:30am
View
System.Text.RegularExpressions.Regex myRegex = new System.Text.RegularExpressions.Regex("^[a-fA-F0-9]+$");
string text = textBox1.Text;
bool isHex = myRegex.IsMatch(text);
if (!isHex)
{
textBox1.Text = text.Substring(0, text.Length - 1);
textBox1.SelectionStart = textBox1.Text.Length;
}
Show More