I have this code:
Where Data is a DataRow.VB Code:
oSqlDataAdapter = New SqlDataAdapter(oSqlCommand) Dim ComBuilder As New SqlCommandBuilder(oSqlDataAdapter) Dim DataRows(0) As DataRow DataRows(0) = Data oSqlDataAdapter.Update(DataRows)
The SQL query of my command is:
No errors occur on the update statement, but it doesn't save to the db.VB Code:
Public ReadOnly Property EditSQL() As String Get Dim SQL As String SQL = "SELECT BookingDetail.BookingKey " SQL &= ",ISNULL(BookingDetail.AssetKey, 0) AS AssetKey " SQL &= ",ISNULL(BookingDetail.ClientKey, 0) AS ClientKey " SQL &= ",ISNULL(BookingDetail.ContactKey,0) AS ContactKey " SQL &= ",ISNULL(BookingDetail.BookedFrom, getDate()) AS BookedFrom " SQL &= ",ISNULL(BookingDetail.BookedTo, GetDate()) AS BookedTo " SQL &= ",ISNULL(BookingDetail.LayoutKey, 0) AS LayoutKey " SQL &= ",ISNULL(BookingDetail.Guests, 0) AS Guests " SQL &= ",ISNULL(BookingDetail.PrepTimeBefore, 0) AS PrepTimeBefore " SQL &= ",ISNULL(BookingDetail.PrepTimeAfter, 0) AS PrepTimeAfter " SQL &= ",ISNULL(BookingDetail.Comments, '') AS Comments " SQL &= ",ISNULL(BookingDetail.UpdateUserID, 0) AS UpdateUserID " SQL &= "FROM BookingDetail " Return SQL End Get End Property
WOka




Reply With Quote