Click here to Skip to main content
15,909,503 members
Home / Discussions / C#
   

C#

 
GeneralRe: Validators are not working in Iframe Pin
MAT100314-Oct-08 21:56
MAT100314-Oct-08 21:56 
GeneralRe: Validators are not working in Iframe Pin
leppie14-Oct-08 22:05
leppie14-Oct-08 22:05 
QuestionC in .Net returning C1004: unexpected end of file found Pin
Member 560524014-Oct-08 21:12
Member 560524014-Oct-08 21:12 
AnswerRe: C in .Net returning C1004: unexpected end of file found Pin
leppie14-Oct-08 21:38
leppie14-Oct-08 21:38 
QuestionHow to set font Roman 10cpi in Crystal Reports Pin
Rajesh.prajapat14-Oct-08 20:13
Rajesh.prajapat14-Oct-08 20:13 
Questionsession in asp.net & c#.net Pin
kamalesh574314-Oct-08 19:48
kamalesh574314-Oct-08 19:48 
AnswerRe: session in asp.net & c#.net Pin
Eduard Keilholz14-Oct-08 20:01
Eduard Keilholz14-Oct-08 20:01 
GeneralRe: session in asp.net & c#.net Pin
kamalesh574314-Oct-08 20:53
kamalesh574314-Oct-08 20:53 
here is my source code whn login button clicked..
can you check for me..


private void Button1_Click(object sender, System.EventArgs e)
{

switch (UserLogin(usertxtname.Text, usertxtpass.Text))
{
case 1:
Session.Abandon();
Login();
break;
case 2:
Label4.Text = "Incorrect Password";
break;
case 3:
Label4.Text = "Incorrect Username";
break;
}
}


public void Login()
{
FormsAuthenticationTicket objTicket = null;
HttpCookie objCookie = null;
string strReturnURL = null;
objTicket = new FormsAuthenticationTicket(1, usertxtname.Text, System.DateTime.Now, DateTime.Now.AddMinutes(60), false, Session.SessionID);

objCookie = new HttpCookie(".ASPXAUTH");
objCookie.Value = FormsAuthentication.Encrypt(objTicket);
Response.Cookies.Add(objCookie);
strReturnURL = Request.QueryString["ULogin.aspx"];

if (strReturnURL != null)
Response.Redirect("ULogin.aspx");
else
Response.Redirect("registration.aspx", false);
}


public int UserLogin(string strUsername, string strPassword)
{
int iReturnValue = 0;
string sql;
OdbcConnection myconn;
OdbcDataReader MyReader = null;
sql="Select count(*) as expr1 From login Where (pword='"+usertxtpass.Text+"')And(uname='"+usertxtname.Text+"')";

myconn= new OdbcConnection ("DSN=myodbc2;SERVER=localhost;DATABASE=misdb;UID=root;PORT=3306");

OdbcCommand cmd = new OdbcCommand(sql, myconn);
cmd.Parameters.Add("@username", strUsername);
cmd.Parameters.Add("@password", strPassword);
cmd.Parameters.Add("@ReturnValue", OdbcType.Int).Direction = ParameterDirection.ReturnValue;
myconn.Open();
MyReader=cmd.ExecuteReader();
MyReader.Read();

iReturnValue = System.Convert.ToInt32(cmd.Parameters["@ReturnValue"].Value.ToString());myconn.Close();
return iReturnValue;
}

%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG

GeneralRe: session in asp.net & c#.net Pin
Mycroft Holmes14-Oct-08 22:09
professionalMycroft Holmes14-Oct-08 22:09 
AnswerRe: session in asp.net & c#.net Pin
Jaffer Mumtaz14-Oct-08 20:30
Jaffer Mumtaz14-Oct-08 20:30 
QuestionCan you give me an idea? Pin
Rasma Raj14-Oct-08 19:28
Rasma Raj14-Oct-08 19:28 
AnswerRe: Can you give me an idea? Pin
Pedram Behroozi14-Oct-08 20:12
Pedram Behroozi14-Oct-08 20:12 
QuestionSetting SQL Server date column to Null using SqlDateTime Pin
Brad Wick14-Oct-08 19:11
Brad Wick14-Oct-08 19:11 
AnswerRe: Setting SQL Server date column to Null using SqlDateTime Pin
Pedram Behroozi14-Oct-08 20:02
Pedram Behroozi14-Oct-08 20:02 
AnswerRe: Setting SQL Server date column to Null using SqlDateTime Pin
Eduard Keilholz14-Oct-08 20:03
Eduard Keilholz14-Oct-08 20:03 
AnswerRe: Setting SQL Server date column to Null using SqlDateTime Pin
Pete O'Hanlon15-Oct-08 4:07
mvePete O'Hanlon15-Oct-08 4:07 
GeneralRe: Setting SQL Server date column to Null using SqlDateTime Pin
Brad Wick15-Oct-08 4:55
Brad Wick15-Oct-08 4:55 
GeneralRe: Setting SQL Server date column to Null using SqlDateTime Pin
Pete O'Hanlon15-Oct-08 9:21
mvePete O'Hanlon15-Oct-08 9:21 
QuestionRunning VLC-Unicast Stream from C# Pin
deezZ14-Oct-08 19:03
deezZ14-Oct-08 19:03 
AnswerRe: Running VLC-Unicast Stream from C# Pin
leppie14-Oct-08 21:41
leppie14-Oct-08 21:41 
QuestionHow to remove dots from space in C# editor? Pin
Mazhar Maruf14-Oct-08 18:46
Mazhar Maruf14-Oct-08 18:46 
AnswerRe: How to remove dots from space in C# editor? Pin
dan!sh 14-Oct-08 18:55
professional dan!sh 14-Oct-08 18:55 
GeneralRe: How to remove dots from space in C# editor? Pin
Mazhar Maruf14-Oct-08 19:04
Mazhar Maruf14-Oct-08 19:04 
GeneralRe: How to remove dots from space in C# editor? Pin
Simon P Stevens14-Oct-08 22:17
Simon P Stevens14-Oct-08 22:17 
GeneralRe: How to remove dots from space in C# editor? Pin
dan!sh 15-Oct-08 4:39
professional dan!sh 15-Oct-08 4:39 

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.