|
hi
im doing parameterized query whereby the user has to enter id and password. im using access database to store my data and using visual studio .net 2003 to build my app. if the id n password match, data is retrieved. i need help to ensure that password typed is of the exact case as stored in database. that means, if password in database is hELLo23 the user cannot access if he types hello23. how do i do that?
second problem is how can i make it such that user types in password and the password appears like this ********?
finally, how do i let password in database appear in encrypted text so that it is impossible to see the password in text format? i read about hash... do i use that? can i have more details?
thanks! =)
|
|
|
|
|
nidhelp wrote:
im doing parameterized query whereby the user has to enter id and password. im using access database to store my data and using visual studio .net 2003 to build my app. if the id n password match, data is retrieved. i need help to ensure that password typed is of the exact case as stored in database. that means, if password in database is hELLo23 the user cannot access if he types hello23. how do i do that?
Use StrComp Function this function can be configired to make Binary Comparison
For example
<br />
Select * From Customers Where StrComp('ContactName','anyNamE',0)=0<br />
The Third Parameter =0 which tell the function use binary Coparison (Case Sensitive) and we compare the return value
From function with zero which mean the two string are equal
To learn more about the function parameters and return value look at StrComp Function[^]
nidhelp wrote:
second problem is how can i make it such that user types in password and the password appears like this ********?
TextBox have Propert Called PasswordChar Set it to The Character you want instead of plain text in your case set
It to *
MCAD
-- modified at 9:16 Sunday 28th August, 2005
|
|
|
|
|
hi
i got error when i tried StrComp Function --> Select * From Customers Where StrComp('ContactName','anyNamE',0)=0. it says something about YourPassword is not in Parameter collection. indeed it's not there. this line is what i wrote in OKbutton click event: oleDbDataAdapter2.SelectCommand.Parameters["YourPassword"].Value = textBox2.Text;
well, i tried to remove that line, but what i typed in password textbox did not successfully sense correct password (eg. hELLo23) and retrieve data from Access and display. It's supposed to sense hELLo23 from hello23 or HELLO23 or any other inputs that are different from that (hELLO23) in my database.
i also tried to do this --> Select * From Customers Where StrComp('ContactName','anyNamE',2)=2 as msdn says write '2' for Microsoft Access only. Performs a comparison based on information in your database. but it seems no difference as writing '0'.
loading of data is fine if i do this --> oleDbDataAdapter2.SelectCommand.Parameters["ID_Number_"].Value = textBox1.Text;
oleDbDataAdapter2.SelectCommand.Parameters["YourPassword"].Value = textBox2.Text;
dataSet41.Clear();
oleDbDataAdapter2.Fill(dataSet41);
if(this.BindingContext[dataSet41, "Table1"].Count == 0)
{
MessageBox.Show("Error Occured");
textBox1.Focus();
}
the only problem is that it's not case-sensitive in password textbox and it shows data even though password case is not the same as db.
i just want to ensure that for password any wrong case will not let user have access to get the data.
thanks a lot!
|
|
|
|
|
another problem is i have these 3 columns AdministratorPwd, YourPassword and userID as part of my Access db table. typing in the 2 textboxes (AdministratorPwd and CustomerID) OR (YourPassword and CustomerID) is supposed to query the db for the same piece of data, that is, i should be able to get data belonging to this particular Customer whether i type (AdministratorPwd and CustomerID) OR (YourPassword and CustomerID).
For eg, i want to view info regarding customerA so i type AdministratorPwd and CustomerID --> admin and CustomerA or i can also type YourPassword and CustomerID --> workerA and CustomerA.
however, when i use querybuilder to write ........ WHERE AdministratorPwd=? OR YourPassword=? AND CustomerID=? I get errors--> Password is not in parameter collection and also i'll be getting CustomerB or some other customer's info from db.
|
|
|
|
|
nidhelp wrote:
finally, how do i let password in database appear in encrypted text so that it is impossible to see the password in text format? i read about hash... do i use that? can i have more details?
you can store password in database in few ways
1-Plain text
but this unsecure
2-Encrypt password and store encrypted text in database
This way better then Store Plain text but the problem with this is you have to store private or secret key which you will use it to encrypt and decrypt the password So if any one gain access to this key it will be easy to decrypt your password
3-One-Way Hash password
this the best way because you dont have to store any private key you hash the password and store it in the database when the user provide his passwod you hash it and compare it with the one stored in the database
For example how to do it you can google it like
One-Way Hashing[^]
MCAD
-- modified at 20:30 Monday 29th August, 2005
|
|
|
|
|
Probably an MD5 or SHA1 or 2 with salt is the best.
Matt Gerrans
|
|
|
|
|
Adding a new element to my solution i can choose by much stuff, in which component and windows form.
Both make a form, but what is the differences if i choose one or other?
|
|
|
|
|
i don't think, that a component "makes" a form
a windows form is a container for different windows controls, whereas a component is a non visual component. for example a sqlConnection or a Timer is a component. components appear during design time on a seperate panel at the bottom of your windows forms designer. while execution components aren't visible - but they work invisible in the background of your application...
|
|
|
|
|
Hi
I have a C# application that uses Crystal Reports 10. I developed a setup project with Visual Studio.
For the Crystal Reports, I added the CrystalReports merge module to the setup.
When installing version 1.0 of my softare, everything works fine. The appliation and the Crystal Reports are installed on the target machine.
Now I have to deploy version 1.1 of the application. When I first remove version 1.0 and then install version 1.1 still everything is fine.
But when I don't uninstall 1.0 first and install version 1.1, the new version of my application is installed, but the Crystal Report dll's are removed from the system!
Any idea why it removes the Crystal dll's when I update?
thanx
Claudio
Claudio's Website
|
|
|
|
|
Hi all,
i wanna know way to store every row in a datagridview into array list
also i wanna know way to sort data by specific column in datagridview
watting u
don't forget me
|
|
|
|
|
How to get address of variable in C# not use unsafe code.
le van giang
|
|
|
|
|
simply you cannot.
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is obliterating us.
|
|
|
|
|
You can't. As there is nothing you could use that address for in safe mode, there is no reason to have the functionality to get it in safe mode.
How do you plan to use it?
---
b { font-weight: normal; }
-- modified at 13:29 Sunday 28th August, 2005
Changed unsafe to safe in my post, as that was what I meant.
|
|
|
|
|
|
You assume absolutely correct.
I modified the post to reflect my original intention.
---
b { font-weight: normal; }
|
|
|
|
|
i'm doing a project which related to C#+Mysql+Crystal report
i have a big problem on crystal report part...
anybody can guide me how to call out the crystal report using MySql ?
thank you
Ben8873
|
|
|
|
|
Hello everyone!
OK, I read and re-read this code like a thrillion times and I can't understand why it's doing this... Please check it out: (VS.NET 2003 solution file)
http://www.sulfurmidis.com/BeepXtreme-srchelp.zip
[^]
OK. When I click on the open button, (File>Open), it's suppossed to make a thread (OpenFileThread()) and open a file. It starts out by making the BIP file and then validating (Check for errors in it) it (BipReader.ValidateBipFile(), file BeepXtreme.cs, line 975) but it stops on there! It doesn't throw me an exception or anything, it just pauses at the if statement on BeepXtreme.cs line 979, and the ValidateBipFile() won't execute because I tried debugging with a pause at line 298 in BipReader.cs. What's causing this?! Thanks very much!
Darth_Sulfur (Sulfurik)
http://www.sulfurmidis.com
http://www.sulfursoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
|
Umm... what's the problem with that code? What's a stack overflow? (Sorry for sounding noobie...)
Thanks!
Darth_Sulfur (Sulfurik)
http://www.sulfurmidis.com
http://www.sulfursoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
|
It's... calling itself? How?
Thanks!
Darth_Sulfur (Sulfurik)
http://www.sulfurmidis.com
http://www.sulfursoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|
|
public BeepCollection FileParams
{
get { return this.FileParams; }
}
Actually, this is same as BeepCollection FileParams_get(){ return FileParams_get() } . Do you see now how it is calling itself? Maybe you know recursion but you was confused by syntax of properties. Properties are syntactic thing only, in reality it generates setter (and getter) functions. Is it clearer now?
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Set Breakpoint at
public BeepCollection FileParams
{
get
{
return this.FileParams;
}
You will see that you will never goes out of the body
Of FileParams Property because the Body Call The
Property again and so on
This Like you wrote somthing like
public int Sum(int i,int x)
{
return Sum(i,x);
}
this will still sum i and x and
MCAD
-- modified at 20:50 Saturday 27th August, 2005
|
|
|
|
|
this property call its self but why did not throw
StackOverflowException
MCAD
-- modified at 20:58 Saturday 27th August, 2005
|
|
|
|
|
Well, is there a better way to do it? I really can't figure it out, I thought that was the correct way to do it... Thanks!
Darth_Sulfur (Sulfurik)
http://www.sulfurmidis.com
http://www.sulfursoft.tk
ftp://tsfc.ath.cx
http://tsfc.ath.cx
hotline://tsfc.ath.cx
|
|
|
|