Results 1 to 3 of 3

Thread: problem with datagrid and adodc when errors occur

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5

    Thumbs down

    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?

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    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:

    Code:
    "" & "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.





    Things I do when I am bored: DotNetable

  3. #3
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width