Question about imported data

  • Hello all! I have a database that I created by importing from an Excel file. I have written a ASP.NET web page to view, insert, update, and delete from the database. I have done this a million times, but never from data that was imported. When I try to update or delete a record in the database that I inserted from the ASP.NET page, it works fine. If I try to update or delete a record that was imported in when I created the database, it fails. Can anybody point me in the right direction with this one? Thank to all!

    Nate

  • Hey,

    Can you update/delete imported records from Query Analyser?

    Can you give an example of an imported record and one which was created (a select from the table would be good) and also can you post your delete statement.

  • Yes I can update and delete from query analyzier. My Select, Update, and Delete statements reads:

    DELETE FROM [PCs] WHERE [ID] = @original_ID AND [Name] = @original_Name AND [Machine_Type] = @original_Machine_Type AND [OS_License_Type] = @original_OS_License_Type AND [Motherboard_Type] = @original_Motherboard_Type AND [Office_License_Type] = @original_Office_License_Type

    SELECT * FROM [PCs]

    UPDATE [PCs] SET [Name] = @Name, [Machine_Type] = @Machine_Type, [OS_License_Type] = @OS_License_Type, [Motherboard_Type] = @Motherboard_Type, [Office_License_Type] = @Office_License_Type WHERE [ID] = @original_ID AND [Name] = @original_Name AND [Machine_Type] = @original_Machine_Type AND [OS_License_Type] = @original_OS_License_Type AND [Motherboard_Type] = @original_Motherboard_Type AND [Office_License_Type] = @original_Office_License_Type

    It's just weird because I've written numerous little apps like this before and they have all worked, even one that I imported data from a speadsheet just like this one. It just doesn't make sense to me. Thanks for your help.

    Thanks,

    Nate

  • Just checking the obvious.

    With regards to the imported data - Do all the fields specified in the WHERE clause contain data? Just wondering if some fields don't contain anything which is why you are not deleting/updating.

    Also, have you run a profiler trace to see what queries the server is actually generating from the app when you try and delete/update the imported data?

  • Hello,

    You should also check the permissions on the data base and the tables involved. If the .Net is accessing the data via a system login or ODBC definition it would have different permissions and therefore results than a straight in login such as yours.

    Just a suggestion.

    Regards,

    Terry

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply