How to delete data from a 2005 SQL Express table...

Posted on 2011-05-02
Last Modified: 2012-06-27
I have a problem with deleting data from tables in SQL Express 2005.

I am new to Visual Studio 2008 and Visual Basic 2008 data access, and am trying to write some code to learn about them.

The problem that I have is that I have added 2 records to a table and cannot seem to delete either record from the Visual Studio 2008 interface to the table data.

I have uploaded a video to so that you can see exactly what my problem is.

Any help would be greatly appreciated.
Question by:cerksees
    LVL 83

    Expert Comment

    Can you show us the code you are using to delete rows?
    LVL 17

    Accepted Solution

    Hi cerksees, I saw your video (nice), you will need to add a primary key column to your Dates table, for example, add a column named DateId, type Int, and mark it as Primary Key, then in your column properties, set this column has an identity column, save the table, that will fix your problem.
    Here a screen shot:
    I think that you are stuck on that because VS designer is not letting you to delete that records, If you want to delete all the data in your table just execute this command by using the SQL Server Management Studio Express:
    DELETE FROM [Dates]

    Open in new window

    This is a way to fix your problem, but you need to analyze your data, maybe you dont need add an extra column, maybe you can mark the Date column as a primary key and you are done.

    Sorry if I dont understand fully your explanation, english is not my first language.

    Author Closing Comment

    Excellent.  BTW, anyone that needs this can get the Microsoft SQL Server Management Studio Express for Sql Express 2005 from

    Be sure and run it from a command line with the command window run as an administrator.  If you don't it may not install correctly.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now