ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

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

Join 300,494 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,862 people online right now. Registration is fast and FREE... Join Now!




How do I check user input with SQL database?

 

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

Not Your Ordinary Programmer
Group Icon

Joined: 21 Mar, 2008
Posts: 1,808



Thanked: 201 times
Dream Kudos: 500
Expert In: .NET

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

Dyslexics Untie!
Group Icon

Joined: 26 Jul, 2007
Posts: 14,714



Thanked: 501 times
Dream Kudos: 11450
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: 11/8/09 04:43AM

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