Hey,

in the website I'm developing, I use a detailView control to view my records. I vreate a custom button to behave as the default Edit/new button of the control for transaction need during the insert or update operation.

When I press on my button, I get an error message saying that:
'Cannot insert null in the column columnName' . However, when I use the default I got no error messag.

I think that the problem is with the parameter collection of the insertCommand or updatecommand but I don't know how to fix the problem.

my code looks like this

vb Code:
  1. open connection
  2. begin transaction
  3. try
  4.     new Logcommand
  5.     detailView1.Insert
  6.     logcommand.execute non query
  7.     commit transacation
  8. catch
  9.     echo error
  10.     rollback transaction
  11. finally
  12.     close connection
  13. end try