15,898,374 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by er.harmanpreetsingh (Top 7 by date)
er.harmanpreetsingh
1-Oct-12 8:37am
View
This is my store proc..
and i think the name provided is right...
My store proc is this..
[dbo].[p_Testportal_Login]
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
Create Proc [dbo].[p_Testportal_Login]
(
@Name VarChar(50),
@Password varChar(50),
@OutRes int OUTPUT
)
AS
set @OutRes = (SELECT count(*) FROM dbo.HRIS_Employee
WHERE Name = @Name And Password = @Password)
if(@OutRes = 1)
begin
set @OutRes = 1--Login is Correct
end
else
begin
set @OutRes = 0 --Bad login
end
er.harmanpreetsingh
1-Oct-12 8:21am
View
Thank you dear 4 your great suuport..
I debug the programme.. it throws the exception.. {"Invalid object name 'dbo.HRIS_Employee'."}..here hris_Employee is my table name.
and my code is..
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace IVPTestPortal
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
txtUsername.Focus();
}
//private bool Authenticate(string userName, string password, string domain)
//{
// bool authentic = false;
// try
// {
// authentic = true;
// }
// catch (Exception ex)
// {
// vldAutheticate.ErrorMessage = "Invalid username and password. Contact your administrater !";
// }
// return authentic;
//}
//Code
public int Validate_Login(String Username, String Password)
{
//SqlConnection con = new SqlConnection(@"User id=sa;Password=123456;Server=LOVE-PC\YES;Database=HRIS_Employee");
SqlConnection con = null;
con = DABase.OpenConnection();
// con.Open();
SqlCommand cmdselect = new SqlCommand();
cmdselect.CommandType = CommandType.StoredProcedure;
cmdselect.CommandText = "[dbo].[p_Testportal_Login]";
cmdselect.Parameters.Add("@Name", SqlDbType.VarChar, 50).Value = Username;
cmdselect.Parameters.Add("@Password", SqlDbType.VarChar, 50).Value = Password;
cmdselect.Parameters.Add("@OutRes", SqlDbType.Int, 4);
cmdselect.Parameters["@OutRes"].Direction = ParameterDirection.Output;
cmdselect.Connection = con;
int Results = 0;
try
{
//con.Open();
cmdselect.ExecuteNonQuery();
Results = (int)cmdselect.Parameters["@OutRes"].Value;
}
catch (SqlException ex)
{
lblMessage.Text = ex.Message;
}
finally
{
cmdselect.Dispose();
if (con != null)
{
con.Close();
}
}
return Results;
}
protected void btnLogin_Click(object sender, EventArgs e)
{
int Results = 0;
if (txtUsername.Text != null && txtPassword.Text != null)
{
Results = Validate_Login(txtUsername.Text, txtPassword.Text);
if (Results == 1)
{
Response.Redirect("TakeTest.aspx");
//lblMessage.Text = "Login is Good, Send the User to another page or enable controls";
}
else
{
lblMessage.Text = "Invalid Login";
lblMessage.ForeColor = System.Drawing.Color.Red;
}
}
else
{
lblMessage.Text = "Please make sure that the username and the password is Correct";
}
}
//code
//protected void btnLogin_Click(object sender, EventArgs e)
//{
// SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString);
// con.Open();
// SqlCommand cmd = new SqlCommand("select * from HRIS_Employee where Username=@Name and Password=@Password", con);
// cmd.Parame
er.harmanpreetsingh
1-Oct-12 3:26am
View
I tried this code but it always shows invalid login
er.harmanpreetsingh
8-Jan-12 12:31pm
View
It is just a drag and drop method to create a browser how could i see the design code behind that form..
er.harmanpreetsingh
8-Jan-12 12:27pm
View
I got it... It perform all the functionality of webbrowser.
But I want to make a executable (.exe) file of it , But it runs only as a form or page. How could I make (.exe) file so that i can run it on any machine.
er.harmanpreetsingh
8-Jan-12 4:58am
View
I created the browser using the foll link...
But help how to make a exe file of it and how could I see its html code in visual studio 2008 http://www.dreamincode.net/forums/topic/59025-create-a-webbrowser/
as using this it just create a form which runs
er.harmanpreetsingh
7-Jan-12 9:16am
View
thanks...
how did you do this code..??
Show More