Click here to Skip to main content
15,914,074 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAsp.Net Window Pop Up Pin
J Liang23-Apr-07 22:27
J Liang23-Apr-07 22:27 
AnswerRe: Asp.Net Window Pop Up Pin
enjoycrack23-Apr-07 23:41
enjoycrack23-Apr-07 23:41 
GeneralRe: Asp.Net Window Pop Up Pin
J Liang24-Apr-07 17:37
J Liang24-Apr-07 17:37 
GeneralRe: Asp.Net Window Pop Up Pin
J Liang24-Apr-07 17:43
J Liang24-Apr-07 17:43 
GeneralRe: Asp.Net Window Pop Up Pin
enjoycrack24-Apr-07 17:53
enjoycrack24-Apr-07 17:53 
GeneralRe: Asp.Net Window Pop Up Pin
J Liang24-Apr-07 18:35
J Liang24-Apr-07 18:35 
Questionmultiple scripts __doPostBack problem Pin
Russell Jones23-Apr-07 22:10
Russell Jones23-Apr-07 22:10 
QuestionLogin control [modified] Pin
daviperke23-Apr-07 21:57
daviperke23-Apr-07 21:57 
This is the code in my login.ascx file.

<%@ Import Namespace="System.Data" %> <br />
<%@ Import Namespace="System.Data.Sql" %><br />
<%@ Import Namespace="System.Data.SqlClient" %><br />
<%@ Import Namespace="System.Data.SqlTypes" %><br />
<br />
<br />
<script language="C#" runat="server"><br />
    <br />
    public String RedirectPage ="Overzicht.aspx";<br />
    <br />
    public int chk;<br />
    <br />
    bool Authenticate(String user, String pass) <br />
    { <br />
	bool authenticated = false;<br />
	try <br />
	{ <br />
           String dsn = "server=localhost;uid=sa;pwd=;database=db";<br />
           //String sSQL = "SELECT emailadres,paswoord FROM tblPersoneelslid where emailadres='" + user.Trim() + "'";<br />
           String sSQL = "SELECT emailadres,paswoord FROM tblPersoneelslid WHERE (emailadres='" + UserName + "' AND paswoord='" + Password + "')";<br />
   	<br />
    SqlConnection Conn = new SqlConnection(dsn);     <br />
   	SqlCommand Cmd = new SqlCommand(sSQL,Conn);    <br />
	SqlDataReader Read1 = null;<br />
        <br />
	Conn.Open();<br />
<br />
    Read1 = Cmd.ExecuteReader();       <br />
	//Cmd.Execute(out Read1);<br />
        <br />
     if (Read1!=null){<br />
	<br />
	if (Read1.Read()) <br />
    { <br />
  		if (Read1.GetString(0)==user)<br />
        {<br />
			if(Read1.GetString(1)==pass){<br />
      				authenticated =true;<br />
        		}<br />
			else<br />
			{<br />
				chk=1;<br />
			}<br />
		}<br />
		else<br />
		{<br />
			chk=2;<br />
		}<br />
 	}<br />
      }<br />
           <br />
	}<br />
	catch(Exception e) <br />
    {<br />
		Response.Write("Foutmelding: " + e.ToString());<br />
	}<br />
<br />
	return authenticated;<br />
    }<br />
<br />
    private void SubmitBtn_Click(Object sender, EventArgs e) <br />
    {  <br />
       if (Authenticate(UserName.Text, Password.Value)) <br />
       { <br />
           Response.Redirect(RedirectPage);<br />
       }<br />
           <br />
       else <br />
       {<br />
		if (chk==1)<br />
        {<br />
			Message.Text="Paswoord ongeldig";<br />
			UserMark.Visible = false;<br />
			PasswordMark.Visible = true;<br />
           	Message.Visible = true;<br />
		}<br />
		else<br />
		{<br />
			Message.Text="Gebruikersnaam ongeldig";<br />
			PasswordMark.Visible = false;<br />
			UserMark.Visible = true;<br />
           	Message.Visible = true;<br />
		}<br />
       	}<br />
    }<br />
    <br />
</script>


and the error i get is:
Foutmelding: System.Data.SqlClient.SqlException: Login failed for user 'sa'. at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at ASP.login_ascx.Authenticate(String user, String pass) in d:\[ STAGE ]\Applicatie\WorkflowLibrary1\WebSite1\login.ascx:line 28

can someone help me with this problem?


-- modified at 4:07 Tuesday 24th April, 2007
AnswerRe: Login control Pin
szukuro23-Apr-07 22:25
szukuro23-Apr-07 22:25 
GeneralRe: Login control Pin
daviperke23-Apr-07 22:57
daviperke23-Apr-07 22:57 
GeneralRe: Login control Pin
szukuro23-Apr-07 23:18
szukuro23-Apr-07 23:18 
GeneralRe: Login control Pin
daviperke23-Apr-07 23:40
daviperke23-Apr-07 23:40 
GeneralRe: Login control Pin
szukuro24-Apr-07 1:04
szukuro24-Apr-07 1:04 
GeneralRe: Login control Pin
daviperke24-Apr-07 1:33
daviperke24-Apr-07 1:33 
GeneralRe: Login control Pin
szukuro24-Apr-07 3:35
szukuro24-Apr-07 3:35 
GeneralRe: Login control Pin
daviperke25-Apr-07 23:02
daviperke25-Apr-07 23:02 
GeneralRe: Login control Pin
szukuro26-Apr-07 1:28
szukuro26-Apr-07 1:28 
GeneralRe: Login control Pin
daviperke26-Apr-07 1:36
daviperke26-Apr-07 1:36 
GeneralRe: Login control Pin
szukuro26-Apr-07 2:31
szukuro26-Apr-07 2:31 
GeneralRe: Login control Pin
daviperke26-Apr-07 2:38
daviperke26-Apr-07 2:38 
Questionchat window Pin
saravanan0523-Apr-07 21:54
saravanan0523-Apr-07 21:54 
AnswerRe: chat window Pin
Shuaib wasif khan23-Apr-07 22:36
Shuaib wasif khan23-Apr-07 22:36 
AnswerRe: chat window Pin
enjoycrack23-Apr-07 23:45
enjoycrack23-Apr-07 23:45 
QuestionVideo streaming in asp.net web application Pin
gouravverma23-Apr-07 21:48
gouravverma23-Apr-07 21:48 
QuestionURGENT>>>>>>>ASP Logging!!! Pin
mabrar23-Apr-07 21:35
mabrar23-Apr-07 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.