PDA

Click to See Complete Forum and Search --> : problem with datagrid and adodc when errors occur


pavan_kumard
Aug 26th, 2000, 12:11 AM
I am working with Adodc control and i am using a datagrid .I also installed service Pack 3 on my system.The problem that i am facing is I have a database table and it has some columns out of which some columns does not allow nulls.The problem is when i insert a particular null value in to a not null clumn with the help o datagrid I get an error.After this error occurs I want to sdisplay a custom message and i want to clear all the fields in that particular row.I am unable to do so.More over When the form is unloading an error message is displayed.I dont want this error message to come.How can I do so.Can any one help me out.Very urgent please?

davidrobin
Aug 28th, 2000, 03:34 PM
There is a lot to answer in you post but I hope I understand correctly. (Sorry my answers may not be specific solutions as it is Bank Holiday Monday and I am at home with a PC that doesn't have vb installed on it.)

Have you looked at using the ISNULL() VB function. If it is a null value you can change the value to "" or something different, maybe display a message.
One thing a lot of people do is append a "" to the beginning of a string to make sure the value is not null like so:

"" & "some string"

isn't there a 'ClearRow' method of the datagrid. Another option to clearing a row is to clear/delete the applicable record in the database and use the 'refresh' method of the datagrid.

As far as the error message you can use error handling in your code.

DrewDog_21
Aug 29th, 2000, 09:16 AM
If I understand one of your problems correctly, you have a field in the database that does accept nullvalues but when you try to insert a record without a value in that field, you get an error. What is the error that is occuring? If it is the error FieldName does not allow a null or zero-length string, check your field definitions to be 100% sure that they are correctly configured.