I've been trying for hours to do this and can't figure it out.. I'm trying to add a new record to a table in my local database.. Heres the SQL code im using at the minute.. I keep getting this error
"The data was truncated while converting from one data type to another. [ Name of function(if known) = ]" on the line
Dim SQLCon As New SqlServerCe.SqlCeConnection Dim SQLCom As New SqlServerCe.SqlCeCommand SQLCon = New SqlServerCe.SqlCeConnection("Data Source = BK.sdf") SQLCon.Open() SQLCom = SQLCon.CreateCommand SQLCom.CommandText = "INSERT INTO [Current Rentals](MemberID,DVDID,DaysonRent,DateRented,DueDate,TotalPrice,Overdue,DaysOverdue,OverduePrice) VALUES('" _ & Trim(tbMemberID.Text) & "','" & Trim(tbDVDID.Text) & "','" & CInt(Trim(cbDays.Text)) & "',GETDATE(),DATEADD(day," & CInt(Trim(cbDays.Text)) & ",GETDATE())" & "," & CDbl(Trim(tbPrice.Text)) & ",'No',NULL,NULL)" MessageBox.Show(SQLCom.CommandText) SQLCom.ExecuteNonQuery() SQLCon.Close()
Any help would be appreciated!