Welcome to Dream.In.Code
Become an Expert!

Join 150,105 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,907 people online right now. Registration is fast and FREE... Join Now!




How do I check user input with SQL database?

 
Reply to this topicStart new topic

How do I check user input with SQL database?

katelva
4 Jul, 2008 - 10:29 PM
Post #1

New D.I.C Head
*

Joined: 4 Jul, 2008
Posts: 1

Hi,

I am newbie in asp.net C#. I created a login.aspx
CODE

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Navigation" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Footer" Runat="Server">
</asp:Content>

<asp:Content ID="Content5" runat="server"
    contentplaceholderid="RightTopContent">
    <asp:Image ID="Image1" runat="server" Height="26px" Width="162px" />
    <br />
    Username :<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
    <br />
    Password :<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
    <br />
    <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click"
        Text="Login" />
    <br />
</asp:Content>
<asp:Content ID="Content6" runat="server"
    contentplaceholderid="RightMiddleContent">
</asp:Content>


But, I do not know the way of writing code(syntax) in login.aspx.cs which I would like to check the user input(username,password) match with the SQL database or not? If the user input is correct in SQL DB then it will redirect to user information page,if not will appear an error page.
I just know how to connect SQL DB in C# asp.net but I do not know the syntax of checking the user input is matching/correct with the SQL DB or not?

Anyone can help?

Thanks.

Regards,
Katelva
User is offlineProfile CardPM
+Quote Post

eclipsed4utoo
RE: How Do I Check User Input With SQL Database?
8 Jul, 2008 - 12:54 PM
Post #2

D.I.C Addict
Group Icon

Joined: 21 Mar, 2008
Posts: 544



Thanked: 29 times
Dream Kudos: 125
My Contributions
look into ADO.Net and using Stored Procedures.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How Do I Check User Input With SQL Database?
9 Jul, 2008 - 08:33 AM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Here is a tutorial on SQL Basics in C# that will walk you through interacting with a SQL database with C#.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 12:55AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month