Click here to Skip to main content
15,918,808 members

Comments by Vivek_Sharma (Top 7 by date)

Vivek_Sharma 7-May-12 2:02am View    
The SelectCommand property has not been initialized before calling 'Fill'.

error accured when using this above format of code
Vivek_Sharma 7-May-12 2:00am View    
Deleted
The SelectCommand property has not been initialized before calling 'Fill'.
when i am following this code given above
Vivek_Sharma 4-May-12 1:27am View    
still i am facing problem with this web method in accessing it in javascript function

[WebMethod]
public static void ChangePass(string UserName,string AltEmail,string OldPass,string NewPass,string ComfPass)
{
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connect"].ConnectionString);
SqlDataAdapter sp = new SqlDataAdapter("select Password from User_Registration where Password='" + OldPass + "'", con);
DataSet ds = new DataSet();
sp.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
SqlDataAdapter dap = new SqlDataAdapter("update User_Registration set Password='" + ComfPass + "' where Email_Id='" + UserName + "'", con);
DataSet ds1 = new DataSet();
dap.Fill(ds1);
MailMessage mail = new MailMessage("tech@xyz.com", AltEmail);
mail.Body = "Email:-" + mail.From + "<br/>" + "New Password:-" + ComfPass;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetCre = new NetworkCredential();
NetCre.UserName = "tech@xyz.com";
NetCre.Password = "abc@123";
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetCre;
smtp.Port = 587;
smtp.Send(mail);

}
}
Vivek_Sharma 1-May-12 1:13am View    
thanks for the solution sir
Vivek_Sharma 30-Apr-12 6:24am View    
Sir i am working on travel domain so i am just trying to ask when ever our clients book there tickets then how can i send confirmation mail with there ticket id which will be display on html form, on there E-mail address using c#