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 |
how to change password in .net with c # with ado.net and also SQL server 2008 change password
I am developing a web application using google map api.I want to update the map inside the div control within update panel. I got other controls updated but map doesn't get updated.I do not not want to update map whenever unnecessary controls are fired at server side.How could it be achieved?
How to Create a Treeview Menu in ASP.NET with C#?
How to use ASP.NET 2.0's TreeView to Display Hierarchical Data?
Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long
how do i copy textbox contents of 1 form to another form
Code for IP Address Comparison and Conversion in C#?
. Write a program to print the following outputs using for loops $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
program to reverse the order of words in a string.
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#
Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.
Code for Reading and writing from a file in c#?