473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Lcase,ucase In Vb.NET

knychtell
Hi there!, i got a problem with classes, can somebody help me with it?
i have created a login form(basic login form) with 2 txtboxes and a pair of buttons, how can i use the LCASE or UCASE, the narative says, that whenever the user inputs a correct PWD and USername,he?she can get access, the username"USER1" is not case sensitive,

i have a sample code here,

dim a,b as string
a= "USER1"
B=LCASE(A)



CAN SOMEONE PLS, HELP ME FIGURE OUT WHY DOES EVERYTIME I TRY TO INPUT A bold letters it actually gives me an error message "wrong username", even if the word user is correct.

thanks a lot,
Feb 5 '07 #1
7 7260
hariharanmca
1,977 1GB
Hi there!, i got a problem with classes, can somebody help me with it?
i have created a login form(basic login form) with 2 txtboxes and a pair of buttons, how can i use the LCASE or UCASE, the narative says, that whenever the user inputs a correct PWD and USername,he?she can get access, the username"USER1" is not case sensitive,

i have a sample code here,

dim a,b as string
a= "USER1"
B=LCASE(A)



CAN SOMEONE PLS, HELP ME FIGURE OUT WHY DOES EVERYTIME I TRY TO INPUT A bold letters it actually gives me an error message "wrong username", even if the word user is correct.

thanks a lot,

which Database you are using (MsAccess or SQL Server)
Feb 5 '07 #2
hariharanmca
1,977 1GB
Hi there!, i got a problem with classes, can somebody help me with it?
i have created a login form(basic login form) with 2 txtboxes and a pair of buttons, how can i use the LCASE or UCASE, the narative says, that whenever the user inputs a correct PWD and USername,he?she can get access, the username"USER1" is not case sensitive,

i have a sample code here,

dim a,b as string
a= "USER1"
B=LCASE(A)



CAN SOMEONE PLS, HELP ME FIGURE OUT WHY DOES EVERYTIME I TRY TO INPUT A bold letters it actually gives me an error message "wrong username", even if the word user is correct.

thanks a lot,
If SQL Server then

===================== Qry===================
SQL Server
----------------
select * from tblUser where UPPER(UserName) like '" & ucase(txtUserName.text) & "' and UPPER(Passward) like '" & ucase(txtPassword.text) & "'

MS Access
------------------

select * from tblUser where UCase(UserName) like '" & ucase(txtUserName.text) & "' and UCase(Passward) like '" & ucase(txtPassword.text) & "'
Feb 5 '07 #3
Thanks, but, maam, its in vb.net, it is just a simple program, all i have to do is just to display a list of names and their equivalent value, i dont use database, just a mere code for a button, a loop.
thanks again for your kindness......
Feb 6 '07 #4
Killer42
8,435 Expert 8TB
Thanks, but, maam, its in vb.net, it is just a simple program, all i have to do is just to display a list of names and their equivalent value, i dont use database, just a mere code for a button, a loop.
thanks again for your kindness......
I think we need to see more of your code. Specifically, the code which decides the user ID is not correct.
Feb 6 '07 #5
im, so sorry, but its not with me right now, im at school, its on my pc,
but, i know the code..
WHAT I DID WAS, I declared several variables as string
for the possible combinations of smmall and big letters fo the word "USER"
it i think its a-n ,might sound really funny but i did it and my prof, lough at.
except "e" you know what i mean,


dim a, b as string
dim z as new frm2
a= "USER1"
b="USEr1"
c="USer1"
d="User1"
f="uSER1"
g="usER1"
h="useR1'
j="user1"
k="UseR1"
l="UsEr1'



i combined these letters to P@ssw0rd
just like the code below,
do
if txtbox1.text =a and txtbox2.text="P@ssw0rd"
then messagebox.show("Welcome User1")
z.show
me.hide
end if
exit do


i wish this could help, if you'l figure it out , you will surely laugh at me......:)
thanks a lot for your responce maa'm......
Feb 6 '07 #6
Killer42
8,435 Expert 8TB
I don't think you need to worry about people laughing at you. We all had to start somewhere, and have probably done very similar things at some time.

I think what you need to do is to use the Lcase or Ucase functions to ensure that both strings are in the same state (UPPERCASE/lowercase) before comparing them. For example...
Expand|Select|Wrap|Line Numbers
  1. If Ucase(Text1.Text) = Ucase(a) Then ...
Feb 6 '07 #7
WHew.... Thanks maa'm it really did help me a lot in my problem, tommorow's the big day for me, thanks again...
Feb 7 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Thomas McK | last post by:
Hi all, I'm trying to make a SQL query (against a table in MS Access) where I want to take the value of something, and check to see if the first two letters in that value are capitalized (for...
12
by: MLH | last post by:
Have had a runtime installation up for 4 months. Upgraded today with new ver 0.07 from 0.06. On launch, error reported... Err in fn Initialize, module AutoExec, function isnt available in query...
4
by: MikeLing | last post by:
Hi, String.IndexOf is case sensitive so I need to covert to lower before testing the string contains a given string. In VB this is: Instr(Lcase(StringToTest, "StringToCheckFor")) What is...
7
by: tsnyder | last post by:
I need to define a field so that when a lowercase letter is put in the field it turns to an uppercase letter. What would the expression for the field be? My field name is site_id.
5
by: Todd Snyder | last post by:
I need to make a field put uppercase letters in it when a lowercase letter is entered into that field. Is there an expression to use or does it have to be written in code? *** Sent via...
16
by: shawno | last post by:
I'm relatively new to DB2 and have noticed a problem with my queries when doing a like with ucase. Since queries need to be case insensitive, I have to do a ucase on the column(s) being searched...
6
lee123
by: lee123 | last post by:
how do you change a certsain field to all caps i have tried this statement but didn't work: txtcompanyname.seltext = ucase(txtcompanyname.Seltext) is this correct or what else do i need to add...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.