On Dec 23, 9:38 am, Cerebrus <[email protected]> wrote:
> I suggest you re-read what Cody wrote.
Ok, fair enough, and i apologize in advance for my lack of
understanding. But that is of course why i'm seeking help.
> > > When posting it back to the SQL server set the field to DBNull.Value
I'm assuming that the
Me.OrdertblTableAdapter.Update(Me.DataSet1.Ordertbl)
is where i need to set the field to dbnull.value since that is where
the updated data is being committed to the DB.
> > > You can't put that inside a textbox's .text property though, which
So do i set the field to "" ? so that it's blank?
> > > means in your database access function that does the write you'll
> > > likely have to check for a blank value and then set it to DBNull.Value
How would I check for a blank value? something like
if me.textbox.text = "" then or maybe if me.textbox.text = nothing ?
and if so, how do you set the value to dbnull without setting the
textbox to some form of null?
> > > just before executing the query back to the server.
When creating the FK, the field is simply set by double clicking on a
datagridview entry and populating the textbox with the appropriate
field value in that gridview. If i doubleclick on the bottom
unpopulated (null) field in the datagridview, it writes null value to
the field and saves perfect. Forgive me if i'm making inaccurate
assumptions, but isn't it just setting the textbox field to null and
then saving the updated data?