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

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 http://www.mediafire.com/?58btnvo1m2m6679 so that you can see exactly what my problem is.

Any help would be greatly appreciated.
cerkseesAsked:
Who is Participating?
 
Carlos VillegasFull Stack .NET DeveloperCommented:
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:
Demo
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.
0
 
CodeCruiserCommented:
Can you show us the code you are using to delete rows?
0
 
cerkseesAuthor Commented:
Excellent.  BTW, anyone that needs this can get the Microsoft SQL Server Management Studio Express for Sql Express 2005 from http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&DisplayLang=en.

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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.