I have problem using datetimepicker in visual C# .net.
I created databes with tables.
One column in my Table need to store date.
I created appropriate dataset dsAB1.
I placed datetimepicker on my form and want to bind its value to desired column.
I have sql adapter and in my fuction Load() I wrote.
I don't want to bind value of datetimepicker in properties with desired colum, because I want to do it in code.
In Databindings property of datetimepicker I bind only text property with my desired column datesell.
When I click button new to enter infos ablut new sell (which all workin ok) and left datetime picker value as is I get following run time error:
Cannot insert NULL in tables column. When I click on datetime picker and choose desired date everything works fine. Problem is that it is not connected until I choose, even when current display of today's date is just what I want.
I don't know if I was enough clear what is my problem exactly, bu in short:
I have colum that is created as not null. I have datetimepicker which display today's date which I need to store (with all others columns) like new row in table.
When I don't touch datetimepicker and try to save get error cannot insert null, but when I click on datetimepicker and choose the same date it bind it somehow, so user of my program must manually choose date that was already displayed.
How to connect value of datetimepicker to desired table and colum after user click to enter new record.
I rtied to paset this code im button_click....
but get exception...!?!