473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Table Adapter Update Method

Hi,

I'm trying to build a database application in Visual Studio 2005. The
language which I'm using is vb.net . I created a new Windows Application,
added a database, created a table, and then used the Configure Dataset
wizard to create a tableset with the new table Table 1. I dragged the
tableset into the form, and Visual Studio 2005 miraculously created a very
nice form for the table. But the problem is, the Save button in the Binding
Navigator control doesn't work. It doesn't give an error, but when I close
the form and open the table to view its data, I can't find the newly entered
data. Any idea how I can make it work?

Shafiee.
Oct 18 '06 #1
6 7479
Shafiee,

Could be that you are actually updating a copy of your database:

http://msdn2.microsoft.com/en-us/library/ms246989.aspx

Kerry Moorman
"Mohamed Shafiee" wrote:
Hi,

I'm trying to build a database application in Visual Studio 2005. The
language which I'm using is vb.net . I created a new Windows Application,
added a database, created a table, and then used the Configure Dataset
wizard to create a tableset with the new table Table 1. I dragged the
tableset into the form, and Visual Studio 2005 miraculously created a very
nice form for the table. But the problem is, the Save button in the Binding
Navigator control doesn't work. It doesn't give an error, but when I close
the form and open the table to view its data, I can't find the newly entered
data. Any idea how I can make it work?

Shafiee.
Oct 18 '06 #2
Mohamed,

I assume that you did it this way, but some things are in my idea different?

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I hope this helps,

Cor

"Mohamed Shafiee" <sh************@hotmail.comschreef in bericht
news:OQ**************@TK2MSFTNGP05.phx.gbl...
Hi,

I'm trying to build a database application in Visual Studio 2005. The
language which I'm using is vb.net . I created a new Windows Application,
added a database, created a table, and then used the Configure Dataset
wizard to create a tableset with the new table Table 1. I dragged the
tableset into the form, and Visual Studio 2005 miraculously created a very
nice form for the table. But the problem is, the Save button in the
Binding Navigator control doesn't work. It doesn't give an error, but when
I close the form and open the table to view its data, I can't find the
newly entered data. Any idea how I can make it work?

Shafiee.

Oct 18 '06 #3
Thanks for the post Mr. Cor.

Last night I figured that it is because I didn't set the DeleteCommand,
UpdateCommand, and InsertCommand properties of the tableset object. Is that
the reason? Those are set to none by default. Do you know how to set those
properties?

Thanks in advance...

"Cor Ligthert [MVP]" wrote:
Mohamed,

I assume that you did it this way, but some things are in my idea different?

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I hope this helps,

Cor

"Mohamed Shafiee" <sh************@hotmail.comschreef in bericht
news:OQ**************@TK2MSFTNGP05.phx.gbl...
Hi,

I'm trying to build a database application in Visual Studio 2005. The
language which I'm using is vb.net . I created a new Windows Application,
added a database, created a table, and then used the Configure Dataset
wizard to create a tableset with the new table Table 1. I dragged the
tableset into the form, and Visual Studio 2005 miraculously created a very
nice form for the table. But the problem is, the Save button in the
Binding Navigator control doesn't work. It doesn't give an error, but when
I close the form and open the table to view its data, I can't find the
newly entered data. Any idea how I can make it work?

Shafiee.


Oct 19 '06 #4
Shafiee,

Mostly you can use the commandbuilder to start with (put it direct before
your update command) although it can in fact be everywere behind the select
or with a strongly typed dataset even before that.

http://msdn2.microsoft.com/en-us/lib...ndbuilder.aspx

I hope this helps,

Cor

"Shafiee" <Sh*****@discussions.microsoft.comschreef in bericht
news:F5**********************************@microsof t.com...
Thanks for the post Mr. Cor.

Last night I figured that it is because I didn't set the DeleteCommand,
UpdateCommand, and InsertCommand properties of the tableset object. Is
that
the reason? Those are set to none by default. Do you know how to set those
properties?

Thanks in advance...

"Cor Ligthert [MVP]" wrote:
>Mohamed,

I assume that you did it this way, but some things are in my idea
different?

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I hope this helps,

Cor

"Mohamed Shafiee" <sh************@hotmail.comschreef in bericht
news:OQ**************@TK2MSFTNGP05.phx.gbl...
Hi,

I'm trying to build a database application in Visual Studio 2005. The
language which I'm using is vb.net . I created a new Windows
Application,
added a database, created a table, and then used the Configure Dataset
wizard to create a tableset with the new table Table 1. I dragged the
tableset into the form, and Visual Studio 2005 miraculously created a
very
nice form for the table. But the problem is, the Save button in the
Binding Navigator control doesn't work. It doesn't give an error, but
when
I close the form and open the table to view its data, I can't find the
newly entered data. Any idea how I can make it work?

Shafiee.



Oct 19 '06 #5
Shafiee wrote:
Last night I figured that it is because I didn't set the DeleteCommand,
UpdateCommand, and InsertCommand properties of the tableset object. Is that
the reason? Those are set to none by default. Do you know how to set those
properties?
The designer will create the Delete, Update and Insert commands for you
if it can gather enough information from your table. Specifically (as
for my *little* experience), it will require at least a primary key in
your table.

Because it seems you're just experimenting with the technology, I'd
suggest you delete the dataset created by the wizard, go back to your
table, add a primary key to it and try the wizard again.

Notice, also, that the Delete/Update/Insert methods won't be created if
the GenerateDBDirectMethods property of the table's TableAdapter is set
to false. If this is the case, set it to true (in the dataset designer,
click the title of the table's TableAdapter window to see the adapter's
properties) and save the dataset, so the designer will create the
methods automagically.

HTH.

Regards,

Branco.

Oct 19 '06 #6
Thank you... I will try that. :)

"Branco Medeiros" wrote:
Shafiee wrote:
Last night I figured that it is because I didn't set the DeleteCommand,
UpdateCommand, and InsertCommand properties of the tableset object. Is that
the reason? Those are set to none by default. Do you know how to set those
properties?

The designer will create the Delete, Update and Insert commands for you
if it can gather enough information from your table. Specifically (as
for my *little* experience), it will require at least a primary key in
your table.

Because it seems you're just experimenting with the technology, I'd
suggest you delete the dataset created by the wizard, go back to your
table, add a primary key to it and try the wizard again.

Notice, also, that the Delete/Update/Insert methods won't be created if
the GenerateDBDirectMethods property of the table's TableAdapter is set
to false. If this is the case, set it to true (in the dataset designer,
click the title of the table's TableAdapter window to see the adapter's
properties) and save the dataset, so the designer will create the
methods automagically.

HTH.

Regards,

Branco.

Oct 19 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JH | last post by:
I have a comma delimited file and I want to export it to an MS access table already designed with appropriate field names. How do I do this programmatically using VB.NET or C#? Thanks for any...
1
by: | last post by:
I will be add Data in my Example Database. I have this Code by a ASP.NET Book but this will not work. Error message: Operation must be a actually Query use. Error in:...
10
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to...
11
by: Eych | last post by:
I get a VB error when I try to update a table whose field I change with the following statement: dcUpdate.Dataset.Tables(0).Rows(0)("User Name") = Me.textbox1.Text if I change the field name...
8
by: Marcel Hug | last post by:
Hi all ! I have datas in a dataset. I would like to save them in a new table (just created). Do I have to run trought all recordsets with an Insert into statement ? (it takes very long) Thanks
1
by: cindy | last post by:
this is the call private void Page_Load(object sender, System.EventArgs e) { OdbcConnection connection = new OdbcConnection ("DSN=PFW52"); CreateDataAdapter(connection); } this is the code,...
1
by: pass Table Adapter as an argument | last post by:
Hi all , I'm just wondering if there is away to pass the tableadapter as an argument for common use purpose for example : public sub Save(pmTableAdapter as TableAdapter)...
0
by: Warren Sirota | last post by:
Hi, I've got a global in-memory table which is kind of a control table for a lot of processes. I've added quite a few non-persisted properties to the row objects in memory, such as collections...
12
by: Randy | last post by:
Hi, Trying to pass along a table row delete to the datasource, but I'm crashing. Here is the code: Private Sub btnDeleteIngr_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.