Click to See Complete Forum and Search --> : database is not updating


yshie
April 30th, 2007, 11:58 AM
SQL SERVER
it's so weird! my codes are working good until... my database is not updating after insert or update command. i don't know what happened but i haven't change anything in my codes. but when i run query, it works good. as far as i know, i deleted rows from my related tables. and i have read that it's one cause. but i don't know what to do. pls help!

Shuja Ali
May 1st, 2007, 12:25 AM
Is it that it is not allowing you to update anything, or is it that only specific tables doesn't allow you to insert or update anything. You need to be bit more specific about your problem.

Tell us what exactly are you doing.

yshie
May 1st, 2007, 01:09 AM
private void buttonRegi_Click(object sender, EventArgs e)
{
using (SqlConnection conn = new SqlConnection(Properties.Settings.Default.PEdbConnectionString))
{

using (SqlCommand cmd = new SqlCommand("INSERT INTO Customers VALUES (@Email, @Passwd)", conn))
{
string autoPW = GeneratePassword();
cmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = textBoxEmail.Text;
cmd.Parameters.Add("@Passwd", SqlDbType.VarChar).Value = autoPW;

conn.Open();
cmd.ExecuteNonQuery();
labelRegiStat.Text = "Registration Successful! \nPassword is " + autoPW;
}
}


this is one example of my insert command. after executing that, no errors appear but no record is actually added in my table..

Shuja Ali
May 1st, 2007, 01:17 AM
You did not answer my previous questions. I don't think there is anything wrong with the code.

yshie
May 1st, 2007, 04:06 AM
oic.. im sorry! yeah, all the tables are not updating..