walaikum salam,
Dear brother i have open the connection below
problem was not with the connection it was with the column which  i
was using
means see this line
string updatePassword = "Update LoginTable set password = ' " +
strConfirmPassword + " ' where username = '" + lblUsername.Text +"' ";

here i have to place password and username in [password], [username]
this same problem i got when i was working in vb6.0
now its clear thanks
for telling me

Take care
Allah hafiz.

Regards,
Mohd Irshad.

On Dec 6, 8:19 am, "khan abuzaid noorulhaque" <[EMAIL PROTECTED]>
wrote:
> assalamualikum
> I have read you problem
> in C#
>
> First open Connection
> then execute the query
>
> string updatePassword = "Update LoginTable set password =
>  ' " + strConfirmPassword + " ' where username = '" + lblUsername.Text +"'
>
> Regards
> Khan Abuzaid
>
> On Fri, Dec 5, 2008 at 12:37 AM, [EMAIL PROTECTED] <
>
> [EMAIL PROTECTED]> wrote:
>
> > Thanks to all I solve the error
>
> > On Dec 3, 7:37 pm, "Mohammad Irshad Ali Ansari"
> > <[EMAIL PROTECTED]> wrote:
> > > hello,
> > > i have got one problem, i m not able to update the password or u can say
> > > that i m not able to change the password help please.
> > > and i m a beginner so please explain me what should i have to do.
> > > and thanks in advance.
> > > please help me
>
> > > string conString = ConnectionClass.MethodConnectionString();
> > >                 OleDbConnection conn = new OleDbConnection(conString);
> > >                 if (conn.State == ConnectionState.Open)
> > >                 {
> > >                     conn.Close();
> > >                 }
> > >                 //string updatePassword = @"Update LoginTable set
> > password =
> > > '" + strConfirmPassword + "'" + "where username = '" + lblUsername.Text +
> > > "'";
> > >                 string updatePassword = @"Update LoginTable set Password
> > =
> > > 'admin' where UserName = 'irshad'" ;
> > >                 conn.Open();
> > >                 OleDbCommand cmdPass = new OleDbCommand(updatePassword,
> > > conn);
> > >                 cmdPass.ExecuteNonQuery();
> > >                 conn.Close();
> > >                 MessageBox.Show("You have successfully Change ur
> > password");
>
> > > Best regards,
> > > Mohammed Irshad

Reply via email to