When I use self-defined database, sometimes the dataadapter can't auto
create insertcommand, updatecommand and deletecommand, it just only create
selectcommand? But when I use these database such as Pub or Northwind in SQL
Server to create dataadapter, it can auto create updatecommand and
deletecommand. Why? 9 1451
Cherishman,
You are probably talking about the dataadapterwizard (the name is in the
toolbox dataadapter I know).
That should work for your database created in MSDE, therefore can you give
more information.
Has every table a primary key by instance?
Cor
"cherishman" <zh*****@mail.nai.edu.cn> When I use self-defined database, sometimes the dataadapter can't auto create insertcommand, updatecommand and deletecommand, it just only create selectcommand? But when I use these database such as Pub or Northwind in SQL Server to create dataadapter, it can auto create updatecommand and deletecommand. Why?
The table I created is in the SQL Server and doesn't have any primary key, I
don't want to set primary key, it can't work?
The table such as:
ID DT Columns1 Columns2
12 2002 12 13
I want to update the field "Columns2" to be 12.
"Cor Ligthert" <no************@planet.nl> дÈëÓʼþ
news:uH**************@TK2MSFTNGP11.phx.gbl... Cherishman,
You are probably talking about the dataadapterwizard (the name is in the toolbox dataadapter I know).
That should work for your database created in MSDE, therefore can you give more information. Has every table a primary key by instance?
Cor
"cherishman" <zh*****@mail.nai.edu.cn>
When I use self-defined database, sometimes the dataadapter can't auto create insertcommand, updatecommand and deletecommand, it just only
create selectcommand? But when I use these database such as Pub or Northwind in SQL Server to create dataadapter, it can auto create updatecommand and deletecommand. Why?
Cherisman,
I am glad it was a good gues of my, it need an primary key to update or to
insert or to delete, that is all.
Cor
"cherishman" <zh*****@mail.nai.edu.cn> The table I created is in the SQL Server and doesn't have any primary key, I don't want to set primary key, it can't work? The table such as: ID DT Columns1 Columns2 12 2002 12 13 I want to update the field "Columns2" to be 12.
"Cor Ligthert" <no************@planet.nl> дÈëÓʼþ news:uH**************@TK2MSFTNGP11.phx.gbl... Cherishman,
You are probably talking about the dataadapterwizard (the name is in the toolbox dataadapter I know).
That should work for your database created in MSDE, therefore can you give more information. Has every table a primary key by instance?
Cor
"cherishman" <zh*****@mail.nai.edu.cn>
> When I use self-defined database, sometimes the dataadapter can't auto > create insertcommand, updatecommand and deletecommand, it just only create > selectcommand? But when I use these database such as Pub or Northwind > in > SQL > Server to create dataadapter, it can auto create updatecommand and > deletecommand. Why? > >
Thank you very much. I find it. but if I want to update some table without
primary key, what can I do?
thanks!
"Cor Ligthert" <no************@planet.nl> дÈëÓʼþ
news:uZ**************@tk2msftngp13.phx.gbl... Cherisman,
I am glad it was a good gues of my, it need an primary key to update or to insert or to delete, that is all.
Cor
"cherishman" <zh*****@mail.nai.edu.cn>
The table I created is in the SQL Server and doesn't have any primary
key, I don't want to set primary key, it can't work? The table such as: ID DT Columns1 Columns2 12 2002 12 13 I want to update the field "Columns2" to be 12.
"Cor Ligthert" <no************@planet.nl> дÈëÓʼþ news:uH**************@TK2MSFTNGP11.phx.gbl... Cherishman,
You are probably talking about the dataadapterwizard (the name is in
the toolbox dataadapter I know).
That should work for your database created in MSDE, therefore can you give more information. Has every table a primary key by instance?
Cor
"cherishman" <zh*****@mail.nai.edu.cn>
> When I use self-defined database, sometimes the dataadapter can't
auto > create insertcommand, updatecommand and deletecommand, it just only create > selectcommand? But when I use these database such as Pub or Northwind > in > SQL > Server to create dataadapter, it can auto create updatecommand and > deletecommand. Why? > >
You can write the insert statement yourself. The real question is why you
would want a table without a primary key. Big No-No in database land. Even
if you just make a column for holding an integer value to give the row
uniqueness, you should do it.
Chris
"cherishman" <zh*****@mail.nai.edu.cn> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... Thank you very much. I find it. but if I want to update some table without primary key, what can I do? thanks!
"Cor Ligthert" <no************@planet.nl> дÈëÓʼþ news:uZ**************@tk2msftngp13.phx.gbl... Cherisman,
I am glad it was a good gues of my, it need an primary key to update or to insert or to delete, that is all.
Cor
"cherishman" <zh*****@mail.nai.edu.cn>
> The table I created is in the SQL Server and doesn't have any primary key, > I > don't want to set primary key, it can't work? > The table such as: > ID DT Columns1 Columns2 > 12 2002 12 13 > I want to update the field "Columns2" to be 12. > > "Cor Ligthert" <no************@planet.nl> дÈëÓʼþ > news:uH**************@TK2MSFTNGP11.phx.gbl... >> Cherishman, >> >> You are probably talking about the dataadapterwizard (the name is in the >> toolbox dataadapter I know). >> >> That should work for your database created in MSDE, therefore can you >> give >> more information. >> Has every table a primary key by instance? >> >> Cor >> >> "cherishman" <zh*****@mail.nai.edu.cn> >> >> > When I use self-defined database, sometimes the dataadapter can't auto >> > create insertcommand, updatecommand and deletecommand, it just only > create >> > selectcommand? But when I use these database such as Pub or >> > Northwind >> > in >> > SQL >> > Server to create dataadapter, it can auto create updatecommand and >> > deletecommand. Why? >> > >> > >> >> > >
Cherishman,
My answer is the same as from Chris.
Cor
Just trying to save you time ;)
Chris
"Cor Ligthert" <no************@planet.nl> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl... Cherishman,
My answer is the same as from Chris.
Cor
"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:ue**************@TK2MSFTNGP10.phx.gbl... You can write the insert statement yourself. The real question is why you would want a table without a primary key. Big No-No in database land. Even if you just make a column for holding an integer value to give the row uniqueness, you should do it.
Chris
Yep,
Either there is some field or combination of fields is unique for every row
or you have no way of uniquely identifying a row.
Big no-no is an understatement!
You're trying to tell it to go update or delete a row, but without being
able to tell it which. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Stephen Noronha |
last post by:
I have a question, please correct me if I am wrong.
I am assuming that a dataadapter establishes a connection and after filling
the dataset or datatable or whatever, will close the connection to...
|
by: Geoff Pennington |
last post by:
I have a class method that returns a DataAdapter. I want to access the
table(s) contained in the DataAdapter. Of course, accessing the DataSets
would be good enough, because I could get the tables...
|
by: Doug Bell |
last post by:
Hi,
I thought I had this sorted this morning but it is still a problem.
My application has a DataAccess Class.
When it starts, it:
Connects to a DB (OLE DB)
If it connects it uses an...
|
by: Zorpiedoman |
last post by:
I keep getting a concurrency exception the second time I make a change and
attempt to update a dataadapter. It appears this is by design, so there must
be something I can do to avoid it.
...
|
by: Danny Ni |
last post by:
Hi,
If I want to programatically add rows to a DataTable, do I call
AcceptChanges per row? Or do I call AcceptChanges after all rows added?
TIA
|
by: susan.f.barrett |
last post by:
Hi,
Despite me being able to type the following in to SQL Server and it
updating 1 row:
> updatestockcategory 1093, 839
In my code, it is not updating any rows.
dataSet = new DataSet();
|
by: Franklin M. Gauer III |
last post by:
I create a simple DATAADAPTER in a webservice project. It creates the
UPDATE, INSERT, DELETE commands for me - no problem.
In vS2005 it creates these commands as RESOURCES in the RESX file (i.e....
|
by: Rich |
last post by:
What is the diffeence bewtween a dataAdapter.InsertCommand and
dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)?
Dim da As SqlDataAdapter
conn.Open
da.SelectCommand =...
|
by: BobLewiston |
last post by:
I can read in an SQL table ("Person.Contact") from AdventureWorks and step through it one row at a time, but when I try to save a record, either one I'm inserting or one I'm editting, I get the...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |