Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 244,186 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,327 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



Thanked: 1 times
My Contributions
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 Lover
Group Icon

Joined: 21 Mar, 2008
Posts: 1,165



Thanked: 117 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

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,265



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

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: 7/4/09 06:17AM

Live ASP.NET Help!

Be Social

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

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month