Re: Add Record - MS Access
That's strange because your message box shoud be displayed regardles of how the Update will end (are you sure you don't get any error messages?)
Or maybe your Update takes too long and it's not finished when you click stop. Try to run through your code step by step using F8 key instead of simply running it.
Re: Add Record - MS Access
Hi,
Noticed i get this error:
A first chance exception of type 'System.NullReferenceException' occurred in SMS Messaging Program.exe
What is it and how do i fix it?
Re: Add Record - MS Access
Which line of code generates this exception?
Do you develop with 'devenv' (standard Visual Studio IDE) or something else?
If you put a breakpoint at the beginning of this procedure and then execute your code line by line (press F8 when breakpoint is hit) you'll find out what line uses a null reference.
Any of these lines can generate a null reference, I suppose:
vb.net Code:
dsNewRow.Item("ID") = logid
dsNewRow.Item("To") = logto
dsNewRow.Item("From") = logfrom
dsNewRow.Item("Message") = logmessage
ds.Tables("SMS").Rows.Add(dsNewRow)
Check the spelling of your fields.
Also check if the da variable is nothing or con variable is nothing.
Re: Add Record - MS Access
Quote:
dsNewRow.Item("ID") = logid
I hope ID is the primary key. Is the ID column in your table an AutoNumber field? If yes, then comment out that line.