Form issue.
-
Hi folks, I am entering data into the db from a winform. The save button handles the insertion of the form data into the db. The form has all fields for insertion into the table. Some field of the table are set to database defaults like
getdate()
andsuser_sname
. When I hit the save button .... the default values are not getting interted into the db they are NULL when i query the db. please provide you suggestions to relove this issue . thanks -
Hi folks, I am entering data into the db from a winform. The save button handles the insertion of the form data into the db. The form has all fields for insertion into the table. Some field of the table are set to database defaults like
getdate()
andsuser_sname
. When I hit the save button .... the default values are not getting interted into the db they are NULL when i query the db. please provide you suggestions to relove this issue . thanksI think we will need to see the code for the save button - please use the "code block" widget when you post it.
All those who believe in psycho kinesis, raise my hand. My :badger:'s gonna unleash hell on your ass. :badger:tastic!
-
Hi folks, I am entering data into the db from a winform. The save button handles the insertion of the form data into the db. The form has all fields for insertion into the table. Some field of the table are set to database defaults like
getdate()
andsuser_sname
. When I hit the save button .... the default values are not getting interted into the db they are NULL when i query the db. please provide you suggestions to relove this issue . thanksCheck ur query otherwise it is not possible to face this type of problem. ;) (And past code also, For more exact answer)
Syed Shahid Hussain
-
Hi folks, I am entering data into the db from a winform. The save button handles the insertion of the form data into the db. The form has all fields for insertion into the table. Some field of the table are set to database defaults like
getdate()
andsuser_sname
. When I hit the save button .... the default values are not getting interted into the db they are NULL when i query the db. please provide you suggestions to relove this issue . thanksi dont know if there is a way but when i face like this problem i did for loop to check if there is a null value and replace it with 0. i hope that will help
-
I think we will need to see the code for the save button - please use the "code block" widget when you post it.
All those who believe in psycho kinesis, raise my hand. My :badger:'s gonna unleash hell on your ass. :badger:tastic!
//SAVE Button Click event
{ tbSystem tb = new tbSystem(); tb.System\_DeliveryDate = System\_DeliveryDateDateTimePicker.Value; tb.System\_Description = System\_DescriptionRichTextBox.Text; tb.System\_Name = System\_NameTextBox.Text; tb.System\_Priority = (int)System\_PriorityComboBox.SelectedValue; tb.System\_Status = (int)System\_StatusComboBox.SelectedValue; //LastEditBy and CreatedBy Fields are set to database default suser\_sname() //LastEditDate and CreationDate are set to database default getdate() try { tmx.tbSystem.InsertOnSubmit(tb); // tmx is the datacontext tmx = new datacontext() tmx.SubmitChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } MessageBox.Show("Date is Validated and saved"); }
-
Check ur query otherwise it is not possible to face this type of problem. ;) (And past code also, For more exact answer)
Syed Shahid Hussain
Just pasted code in the reply above