No Delete or Update Commands

G

Guest

I am using VS2005. I created a Windows Appication project. Inside the
Server Explorer, I created a new SQLExpress database, and then created a new
table. I added the rows, making my first row an integer, and setting the
identity property to true. I set that row to be my primary key. I then
added a dataset, and added my table to the dataset. When I configure the
table, I have no Update or Delete commands, even though the wizard has the
appropriate checkmarks, and the final screen says that it created these
commands. How do I create these commands?
 
G

Guest

I went into the Server Explorer, and chose "Add Connection". I then added
the DataSet to my project, and then configured it with the TableAdapter
Configuration Wizard. I realize that there are myriad ways to make a
connection to a SQL Server, but this is the way that is built right into
Visual Studio, using the SQLExpress database.
 
C

Cor Ligthert [MVP]

Vernon,

I have almost the same effect if there is a timestamp in the data, is it
like that?

Cor
..
 
G

Guest

Yes, it does. I am aware that without the primary key being assigned in the
table adapter, there will be no Delete and Update, but I have that assigned.
 
G

Guest

There is no time stamp. It's a pretty vanilla table. Just a few strings,
along with an autonumber ID field set as the primary key.
 
R

RobinS

I found this confusing:

If I assume that you meant columns, does that mean you only have one
column? If so, that might explain why you can't update it, with it being a
primary key. Try adding some more fields to your table and regenerating
your dataset and see what it does.

Robin S.
----------------------------------
 
G

Guest

I'm a dope. I meant columns, not rows. I have no data in the table, as I
haven't been able to Update.
 
R

RobinS

It's okay, I just wanted to make sure I was understand. So you can't get
Insert to work, either, huh?

Just for grins, now that the table is there, try creating your dataset
again. To just create a dataset, right-click on your project, choose Add
New Item, and pick Data Set.

After it's created, click on the table adapter, and look at the properties.
Are the command objects given?

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
---------------------------------------------------------
 
R

RobinS

Are there Insert and Select command objects?

Robin S.
-----------------------------------------
 
R

RobinS

Figures. Maybe the delete and update commands aren't created because you
have no data in the table to delete or update. What if you add a couple of
rows (in Server Explorer, open until you find the table, and right-click on
it and choose ShowTableData. Then you can type some data into the table.
This is not unlike Access; you have to hit return or go to a different line
to commit the change on a line.

Then try recreating your dataset and see if the Update and Delete commands
are created.


Robin S.
---------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top