Cant insert and delete

Hi,

Can anyone help me I am using MSDE 2000 with VS.NET. I can SELECT from the database but i cant insert and delete and update. Below are my code

public static int Add(string tmpSql, string connectionString)

{

oleConn = new OleDbConnection(connectionString);

oleConn.Open();

oleTran = oleConn.BeginTransaction();

try

{

oleCom = new OleDbCommand(tmpSql, oleConn);

oleCom.Transaction = oleTran;

int a =oleCom.ExecuteNonQuery();

return(0);

}

catch

{

oleTran.Rollback();

return(1);

}

finally

{

oleConn.Close();

}

}

my int a give a value of 1 but when i look at the database the data is not inserted but my primary key of the table did increase by one. what went wrong is it due to my configuration which dun allow my to insert and update help. Thank you



Answer this question

Cant insert and delete