FuneralofSmiles Posted December 7, 2003 Posted December 7, 2003 I'm working on a project that displays a datagrid with the table contents and then I am also binding a few textboxes to the fields in the table. I know you can update the database from the datagrid but what I want to do is update from the textboxes as well. But when I try all I get is an error message saying that this field does not allow a Null value. How can I allow a user to update a database from the textboxes instead of the datagrid? Any help will be greatly appreciated. :) Quote
mocella Posted December 8, 2003 Posted December 8, 2003 First, does the column that you're trying to pass a null value from the form even allow Nulls? That's the first thing you'll need to check. If your column is defined to allow nulls: This is what I do for one of my forms to either set a value to a NullString, or to wrap the date string with single-quotes: dim strEffDt as string = strEffDt = txtBusEffDate.Text strEffDt = IIf(strEffDt = vbNullString, "Null", "'" & strEffDt & "'") Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.