how to change password in .net with c # with ado.net and
also SQL server 2008
change password
Answer / arun
SqlConnection objconnection = new SqlConnection();
protected void Page_Load(object sender, EventArgs e)
{
//objconnection = new OleDbConnection(ConfigurationManager.ConnectionStrings["Constr"].ConnectionString);
// objconnection.Close();
// lblInfo.Visible = false;
}
protected void Button1_Click(object sender, EventArgs e)
{
String strUsername = txtUsername.Text;
String strPassword = txtCurrentpassword.Text;
SqlConnection con = new SqlConnection("Data Source=ARUN-PC\\SQLEXPRESS;Initial Catalog=newspaper;Integrated Security=True");
con.Open();
//objectcon=new ObjectCon();
SqlCommand objcommand;
SqlDataReader objdatareader;
//OleDbCommand cmd = new OleDbCommand("Select Username,Password from Admin", objconnection);
//OleDbDataReader dr;
//jcon = new objcon();
objcommand = new SqlCommand("Select Username,Password *from Login", objconnection);
objdatareader =objcommand.ExecuteReader();
{
if (txtUsername.Text ==objdatareader.GetValue(0).ToString())
if (txtCurrentpassword.Text ==objdatareader.GetValue(1).ToString())
{
SqlCommand cmd = new SqlCommand("Update Login set Password='" + txtNewPassword.Text + "' where Username ='" + txtUsername.Text + "'", objconnection);
cmd.ExecuteNonQuery();
}
else
{
lblInfo.Visible = true;
}
else
{
lblInfo.Visible = true;
}
}
con.Close();
}
}
but my programme is not running
Is This Answer Correct ? | 1 Yes | 6 No |
program to reverse the order of words in a string.
Can you declare an array of mixed Types?
. Write a program to print the following outputs using for loops $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik
How to Link Different Data Sources Together?
program to reverse the order of digits in a given number of any length.
"c sharp" code for factorial using static variables
Coding for using Nullable Types in C#?
Write a program. there are 1..n numbers placed in an array in random fashion with one integer missing. find the missing number.
Give the code for Handling Mouse Events?
Write a program to convert postfix expression to infix expression.
Write a program to count the number of characters, number of words, number of line in file.