|
benjamin yap wrote: the problem is how do i validate the username and password
Query against your table that holds the login. If it comes back with an empty dataset, then login has failed, otherwise login worked.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
StringBuilder sqlQuery = new StringBuilder();
sqlQuery.Append("Select nric,password from Staff where nric = "+txtUsername.Text+" and password="+txtPassword.Text);
like tthis? can you provide me with some example? i have never use access with c# before 
|
|
|
|
|
Yes, something along those lines is a good start. Instead of string concatenation, which allows for sql injection attacks, google up on using parameterized queries for a more secure approach
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
how do i check if row is empty
|
|
|
|
|
After you execute the query and get the dataset back, use the Count property. If it's zero, then the login credentials are invalid.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
do you have any article that can help me with this? as in excuting the query, and getting the dataset?
|
|
|
|
|
Look up the methods in the TableAdapter class and the DataSet class.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi friends :
i want to read Prive1.edb file.this file is an exchange database file.
i want to get mailboxes from this file .
is there any one to help me
thx
|
|
|
|
|
This[^] may help?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hello everyone,
For the following code, what means {0, 3}? I have searched MSDN but can not find the related format description.
String.WriteLine ("{0, 3} : {1}", str1, str2);
thanks in advance,
George
|
|
|
|
|
It's an alignment specification. See this link[^] for more information, especially the examples at the bottom of the page.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks Greeeg,
Question answered.
regards,
George
|
|
|
|
|
I'm using Visual Studio 2008 Professional and can't get any other icon to display apart from the default 'gear'. I'm not trying to use my own bitmap - just one from the built in controls.
I'm adding this attribute:
[System.Drawing.ToolboxBitmap(typeof(System.Windows.Forms.TextBox))]
I've tried with with a user control, component and a simple class that inherits from TextBox but none of them work.
I'm sure I had this working in 2005 - is it a 2008 issue?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Wierd. If I complie the control to a dll and then add it to the toolbox via Choose Items it shows the icon.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
hello, i wonder how it is possible to get hardware information using C#,net! e.g i want to access the thermal sensor of a graphic card , how is it possible ? ! and let me know if it is even possible under C#.net! i gave it a try and turned up with "Sensor class" in MSDN , but i dont know how to use it ,
another question is , as a matter of getting access to hardware infos, is C# limited compared to VC++?
i mean can i do those thing in C# that im capable of doing in vc++?/.. if yes what specifically can be done as hardware manipulating in C#?
tanx in advance
|
|
|
|
|
Member 4166824 wrote: thermal sensor
u can access the info only if the vendor has and gave the ability to Access
it, if not u'll need to try Assembly (
the thermal sensor is problematic
either way to Access hardware u can try The WMI way :
This[^] Will Help Get Started
Have Fun
Never forget it
|
|
|
|
|
Hi,
How to convert mp3 to wav file.How to do it.if anybody know plz.thanks in advance
|
|
|
|
|
http://media-convert.com/[^]
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Good Day,
I'm working with the AES Decryptor (using RijndaelManaged), but when I try to initialize a byte[] array to store my ciphertext data, it throws an IndexOutOfRange exception.
using (FileStream Ciphertext = new FileStream(_InputPath, FileMode.Open, FileAccess.Read, FileShare.None))
{
using (FileStream PlainText = new FileStream(_OutputPath, FileMode.Create, FileAccess.Write, FileShare.None))
{
using (CryptoStream CStreamWriter = new CryptoStream(PlainText, Decryptor, CryptoStreamMode.Write))
{
byte[] CTextData = new byte[Ciphertext.Length];
The exact error message is: "Index was outside the bounds of the array."
The weird thing is, this only happens for file > 200MB. But for a 150mb file, I have no problem.
Please advice thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Perhaps because the system is unable to allocate an array that large.
Don't read the entire file at once, there is no reason to have all the data in memory at the same time. Create a buffer and read only a small part of the file each time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ihave a asp.net page having some textboxes and dropdownlists , and one checkbox ,
i want that when i check checkbox and click the sibmit button then this data of the page should be redirect to next page but with the checkbox to be transfered as checked and readonly. and also i have three textboxes whose values are taken froma datebox which i created from javasript. so i want this date value also to be transfered to the next page. the next page is of data updation so in the next page all this value will be send and when in that next page i can click update button and then i will get be redirect or get a update success message on the same or another page .
my 1st page name is first_page
2nd page name is secound_page
database table name is enf_data
please tell me how to do all this.
|
|
|
|
|
Well, this one has me stumped.
VS2008 Targetting .NET 3.5 (error also occurs when targetting .NET 2.0)
Given the following code:
private void OnBrowse(object sender, EventArgs e)
{
var fd = new OpenFileDialog
{
Filter = "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*",
Multiselect = false
};
if (fd.ShowDialog() == DialogResult.OK)
pictureBox1.Load(fd.FileName);
}
in a very simple WinForms app. The code loads and displays an image in the picture box control. So I know that part is working.
The following code:
private void OnSave(object sender, EventArgs e)
{
try
{
pictureBox1.Image.Save(@"c:\src\test\image.bmp", ImageFormat.Bmp);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
throws an 'A generic error occurred in GDI+' exception. The image file loaded in the OnBrowse handler is not the same image file I'm trying to save to. The target directory has read and write permissions. The output file is created when I run the program but has a length of zero bytes.
I've searched Google and all the solutions indicate a permissions error, which would make sense if the file isn't even created but, as it is created, I can't see it being a permission problem.
Any hints would be gratefully received.
modified on Sunday, July 27, 2008 5:55 AM
|
|
|
|
|
Hi,
this is my standard advice on Image.Save problems:
Most, if not all, errors inside GDI+ are reported as "generic problem occurred in
GDI+". If the affected line is an Image.Save chances are your path is incorrect or
inaccessible, your disk is full, or your destination file exists and is locked.
if you load an image from a file, most of the time the file remains locked as long as
the Image is alive. This would prevent you from saving an image to the same path.
It applies to Image.FromFile, and probably also to PictureBox.ImageLocation
The one exception I am aware of is when you use Image.FromStream
An alternative work-around is to work with a copy of the image:
load the image with Image.FromFile,
create a new image from it with new Bitmap(Image),
dispose of the original image.
Hope this helps.
|
|
|
|
|
Thanks for the advice Luc. Obviously the image in the pictureBox is locked because I changed the code to load the image into a new Bitmap object and save from there and it's now working.
|
|
|
|
|
You're welcome.
|
|
|
|