473,407 Members | 2,314 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,407 software developers and data experts.

login button problem

Hi i created a login form and even i created register button, i am able to place all the values in the data base in the register page but what is the codding for login button, how it checks weather user name and password from the data base

i have written coding for login button as
sql dataadapter da= new sqldatadapter();
da="select * from login where username='"+textbox1.text+"'"&& password='"+textbox2.text+"'";

but it is not working
Thank you
raghu
Apr 29 '08 #1
2 1266
vee10
141 100+
hi,

should not use the && for queries
da = "select * from login where username ='"+textbox1.text+"' and password ='"+textbox2.text + "'";





Hi i created a login form and even i created register button, i am able to place all the values in the data base in the register page but what is the codding for login button, how it checks weather user name and password from the data base

i have written coding for login button as
sql dataadapter da= new sqldatadapter();
da="select * from login where username='"+textbox1.text+"'"&& password='"+textbox2.text+"'";

but it is not working
Thank you
raghu
Apr 29 '08 #2
Frinavale
9,735 Expert Mod 8TB
Hi i created a login form and even i created register button, i am able to place all the values in the data base in the register page but what is the codding for login button, how it checks weather user name and password from the data base

i have written coding for login button as
sql dataadapter da= new sqldatadapter();
da="select * from login where username='"+textbox1.text+"'"&& password='"+textbox2.text+"'";

but it is not working
Thank you
raghu
You are vulnerable to an SQL Insertion Attack if you use this code as is.
When you are forming an SQL query you should use Paramaters instead of concatenating user data into your SQL statements.

Please read the article on How to use a database in your program for an explanation on how to do this....you should also do research into DataAdapters and DataSet

-Frinny
Apr 29 '08 #3

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

Similar topics

10
by: amit.purohit | last post by:
hi, I have a very strange problem on my login Page. the Page was working fine a few days back, but now does not generate post back events for controls. this login page uses form based...
7
by: Cemal Karademir | last post by:
Hi, I'm workin on a small Login page/program with asp.net. It uses an MS-Access database that looks like this: USERID | NAME | PASSWORD _________________________________ 1 ...
7
by: Grant Merwitz | last post by:
Hi I am trying to get the enter key to submit my login form The login form is currently in a control on the page and uses an asp:imagebutton as it's login button. If a user presses enter...
3
by: Dam6 | last post by:
Okay... Using vb .net within DW MX2004, connecting to an access database: Background: I have created a simple login.aspx page that is supposed to re-direct to default.aspx using...
14
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a...
0
by: John | last post by:
Hi I am using a login in template mode as I have customised it. I have added an image as a 'New User' button using the following code; <a class="button" href="Default2.aspx"> <asp:Image...
5
by: Glen | last post by:
Does anybody know a way to make the button on the Login control be the default button on the page? I have a master page with an ImageButton and a content page with a Login control. When I enter...
1
by: Jeff Lynch | last post by:
I'd like to add the following attributes to the Login control's Login Button to create a CSS rollover effect. How can I access the control's login button from the page's code-behind? ...
5
by: Afshar | last post by:
Hi everybody there, I have a special Login page that wants users to enter 3 passwords rather than a single password. But can't do it with Login control. I tried following scenarios: 1. Put an...
5
by: guy | last post by:
I am not a web developer so this is probably easy! in a web app i have a login page if a user logs in, does stuff, logs out - which takes them back to the login page - how do i stop a new user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.