Just the adapter's insert and update commands..

Signature
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
Hi Miha!
Here comes the code finaly...
The fieldname is TotalWorkHour
/Regards
Martin
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert,
true)]
public virtual int Insert(int ProjectSub, int ProjectMain, string
Description, System.Nullable<bool> ProjectLocked, System.Nullable<int>
TotalWorkTime, int CustomerNo, int ContactID, string DescriptionOfProject,
System.Nullable<int> TotalWorkHour) {
this.Adapter.InsertCommand.Parameters[0].Value = ((int)(ProjectSub));
this.Adapter.InsertCommand.Parameters[1].Value = ((int)(ProjectMain));
if ((Description == null)) {
throw new System.ArgumentNullException("Description");
}
else {
this.Adapter.InsertCommand.Parameters[2].Value = ((string)(Description));
}
if ((ProjectLocked.HasValue == true)) {
this.Adapter.InsertCommand.Parameters[3].Value =
((bool)(ProjectLocked.Value));
}
else {
this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
}
if ((TotalWorkTime.HasValue == true)) {
this.Adapter.InsertCommand.Parameters[4].Value =
((int)(TotalWorkTime.Value));
}
else {
this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
}
this.Adapter.InsertCommand.Parameters[5].Value = ((int)(CustomerNo));
this.Adapter.InsertCommand.Parameters[6].Value = ((int)(ContactID));
if ((DescriptionOfProject == null)) {
this.Adapter.InsertCommand.Parameters[7].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[7].Value =
((string)(DescriptionOfProject));
}
if ((TotalWorkHour.HasValue == true)) {
this.Adapter.InsertCommand.Parameters[8].Value =
((int)(TotalWorkHour.Value));
}
else {
this.Adapter.InsertCommand.Parameters[8].Value = System.DBNull.Value;
}
System.Data.ConnectionState previousConnectionState =
this.Adapter.InsertCommand.Connection.State;
if (((this.Adapter.InsertCommand.Connection.State &
System.Data.ConnectionState.Open)
!= System.Data.ConnectionState.Open)) {
this.Adapter.InsertCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
this.Adapter.InsertCommand.Connection.Close();
}
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update,
true)]
public virtual int Update(
int ProjectSub,
int ProjectMain,
string Description,
System.Nullable<bool> ProjectLocked,
System.Nullable<int> TotalWorkTime,
int CustomerNo,
int ContactID,
string DescriptionOfProject,
System.Nullable<int> TotalWorkHour,
int Original_ProjectID,
int Original_ProjectSub,
int Original_ProjectMain,
string Original_Description,
System.Nullable<bool> Original_ProjectLocked,
System.Nullable<int> Original_TotalWorkTime,
int Original_CustomerNo,
int Original_ContactID,
System.Nullable<int> Original_TotalWorkHour,
int ProjectID) {
this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(ProjectSub));
this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(ProjectMain));
if ((Description == null)) {
throw new System.ArgumentNullException("Description");
}
else {
this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Description));
}
if ((ProjectLocked.HasValue == true)) {
this.Adapter.UpdateCommand.Parameters[3].Value =
((bool)(ProjectLocked.Value));
}
else {
this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
}
if ((TotalWorkTime.HasValue == true)) {
this.Adapter.UpdateCommand.Parameters[4].Value =
((int)(TotalWorkTime.Value));
}
else {
this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
}
this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(CustomerNo));
this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(ContactID));
if ((DescriptionOfProject == null)) {
this.Adapter.UpdateCommand.Parameters[7].Value = System.DBNull.Value;
}
else {
this.Adapter.UpdateCommand.Parameters[7].Value =
((string)(DescriptionOfProject));
}
if ((TotalWorkHour.HasValue == true)) {
this.Adapter.UpdateCommand.Parameters[8].Value =
((int)(TotalWorkHour.Value));
}
else {
this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value;
}
this.Adapter.UpdateCommand.Parameters[9].Value =
((int)(Original_ProjectID));
this.Adapter.UpdateCommand.Parameters[10].Value =
((int)(Original_ProjectSub));
this.Adapter.UpdateCommand.Parameters[11].Value =
((int)(Original_ProjectMain));
if ((Original_Description == null)) {
throw new System.ArgumentNullException("Original_Description");
}
else {
this.Adapter.UpdateCommand.Parameters[12].Value =
((string)(Original_Description));
}
if ((Original_ProjectLocked.HasValue == true)) {
this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(0));
this.Adapter.UpdateCommand.Parameters[14].Value =
((bool)(Original_ProjectLocked.Value));
}
else {
this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(1));
this.Adapter.UpdateCommand.Parameters[14].Value = System.DBNull.Value;
}
if ((Original_TotalWorkTime.HasValue == true)) {
this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0));
this.Adapter.UpdateCommand.Parameters[16].Value =
((int)(Original_TotalWorkTime.Value));
}
else {
this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1));
this.Adapter.UpdateCommand.Parameters[16].Value = System.DBNull.Value;
}
this.Adapter.UpdateCommand.Parameters[17].Value =
((int)(Original_CustomerNo));
this.Adapter.UpdateCommand.Parameters[18].Value =
((int)(Original_ContactID));
if ((Original_TotalWorkHour.HasValue == true)) {
this.Adapter.UpdateCommand.Parameters[19].Value = ((object)(0));
this.Adapter.UpdateCommand.Parameters[20].Value =
((int)(Original_TotalWorkHour.Value));
}
else {
this.Adapter.UpdateCommand.Parameters[19].Value = ((object)(1));
this.Adapter.UpdateCommand.Parameters[20].Value = System.DBNull.Value;
}
this.Adapter.UpdateCommand.Parameters[21].Value = ((int)(ProjectID));
System.Data.ConnectionState previousConnectionState =
this.Adapter.UpdateCommand.Connection.State;
if (((this.Adapter.UpdateCommand.Connection.State &
System.Data.ConnectionState.Open)
!= System.Data.ConnectionState.Open)) {
this.Adapter.UpdateCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
this.Adapter.UpdateCommand.Connection.Close();
}
}
}
> Just the adapter's insert and update commands..
>
[quoted text clipped - 30 lines]
>>>>>
>>>>> Or even better, remove entire column :-)