We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Dataset Udate with NULL field

Thread ID:

Created:

Platform:

Replies:

8701 Nov 17,2003 12:38 PM Windows Forms 0
loading
Tags: FAQ
Peter
Asked On November 17, 2003 12:38 PM

Hi all. In the following code how do I update my dtaset with "NULL" when the value of my TextBox17.Text="Null"?? Thank you. Peter '----------------- CODE --------------------------- strConn = ConnectionString() Dim ocon As OleDb.OleDbConnection = New OleDbConnection(strConn) ocon.Open() Dim sql5 As String 'This will be a true Add New Inspection sql5 = "Select * from Inspections" Dim daInspect As New OleDbDataAdapter("Select * from Inspections", ocon) Dim Inspections As New DataSet() daInspect.FillSchema(Inspections, SchemaType.Source, "Inspections") daInspect.Fill(Inspections, "Inspections") Dim tblInspect As New DataTable() tblInspect = Inspections.Tables("Inspections") Dim drI As DataRow drI = tblInspect.NewRow If Not TextBox17.Text = "" Then drI("PropAddress1") = TextBox17.Text tblInspect.Rows.Add(drI) Dim objCommandBuilder As New OleDbCommandBuilder(daInspect) daInspect.Update(Inspections, "Inspections") ocon.Dispose() daInspect.Dispose()

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;