473,703 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataAdapter, sedond update

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.

Example:

I have a dataadapter that contains one table with one row. I change the
value of the 'FisrtName' column in that row from Jack to John. I call
..update on the dataadapter it goes through fine. Now I change that same
column in that same row from John to Peter. Update fails. I'ts because the
'origianl' value is still getting passed as the parameter value in the update
command. In other words, it is looking for a row where firstname = 'Jack'
and finds none.

How do you get the updated values to become the current values for
subsequent updates without making an additional run back to the database to
refresh the whole dataset?

Thanks!
--
--Zorpie
Dec 12 '05 #1
8 2695
Zorpiedoman,

Datasets (and datatables and datarows) have an AcceptChanges method for
making the current values the original values.

Kerry Moorman

"Zorpiedoma n" wrote:
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.

Example:

I have a dataadapter that contains one table with one row. I change the
value of the 'FisrtName' column in that row from Jack to John. I call
.update on the dataadapter it goes through fine. Now I change that same
column in that same row from John to Peter. Update fails. I'ts because the
'origianl' value is still getting passed as the parameter value in the update
command. In other words, it is looking for a row where firstname = 'Jack'
and finds none.

How do you get the updated values to become the current values for
subsequent updates without making an additional run back to the database to
refresh the whole dataset?

Thanks!
--
--Zorpie

Dec 12 '05 #2
Thanks, but I've already been down that road. The DataSet is behaving
'properly' in that the row shows a unchanged after the first update, then
shows as modified just prior to the second update. The problem is that the
parameter for the updatecommand (which was built using the commandbuilder
method) still holds the ORIGINAL value (Jack, in my example) when it tries to
do the update.

-js
--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Datasets (and datatables and datarows) have an AcceptChanges method for
making the current values the original values.

Kerry Moorman

"Zorpiedoma n" wrote:
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.

Example:

I have a dataadapter that contains one table with one row. I change the
value of the 'FisrtName' column in that row from Jack to John. I call
.update on the dataadapter it goes through fine. Now I change that same
column in that same row from John to Peter. Update fails. I'ts because the
'origianl' value is still getting passed as the parameter value in the update
command. In other words, it is looking for a row where firstname = 'Jack'
and finds none.

How do you get the updated values to become the current values for
subsequent updates without making an additional run back to the database to
refresh the whole dataset?

Thanks!
--
--Zorpie

Dec 12 '05 #3
Zorpiedoman,

Are you saying that you are doing this:

1. Change the value of FirstName from Jack to John.
2. Call Update on the dataadapter.
3. Call AcceptChanges on the dataadapter.
4. Change the value of FirstName from John to Peter.
5. Call Update on the dataadapter.

And you get a concurrency violation?

Kerry Moorman

"Zorpiedoma n" wrote:
Thanks, but I've already been down that road. The DataSet is behaving
'properly' in that the row shows a unchanged after the first update, then
shows as modified just prior to the second update. The problem is that the
parameter for the updatecommand (which was built using the commandbuilder
method) still holds the ORIGINAL value (Jack, in my example) when it tries to
do the update.

-js
--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Datasets (and datatables and datarows) have an AcceptChanges method for
making the current values the original values.

Kerry Moorman

"Zorpiedoma n" wrote:
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.

Example:

I have a dataadapter that contains one table with one row. I change the
value of the 'FisrtName' column in that row from Jack to John. I call
.update on the dataadapter it goes through fine. Now I change that same
column in that same row from John to Peter. Update fails. I'ts because the
'origianl' value is still getting passed as the parameter value in the update
command. In other words, it is looking for a row where firstname = 'Jack'
and finds none.

How do you get the updated values to become the current values for
subsequent updates without making an additional run back to the database to
refresh the whole dataset?

Thanks!
--
--Zorpie

Dec 12 '05 #4
Almost. There is no acceptchanges on the dataadapter object, but I HAVE
called it on the DataSet that the data adapter fills. It does not matter,
however.

The root of the problem is this: The Update Command, which was built by the
command builder, has a gazillion parameters. It actually checks to find the
exact row it had at the time of filling in order to update.

Let's say my table had only two columns, ID and FirstName. When I call
mydataadapter.f ill(mydataset) the data set is filled. The update command,
built by the command builder, looks something like this:

"Update SomeTable Set FirstName = @p1 Where (ID is null or ID = @p2) and
(FirstName is null or Firstname = @p3)"

After the fill, the parameter values are : @p2 = 12345, @p3 = 'Jack'

I change FirstName from Jack to John and call the update on the dataadapter.

No problem. Database is updated, Datatable is updated, marked unchanged,
etc. All is well.

Then I change FirstName from 'John' to 'Peter' When I call .update on the
dataadapter, the value of the parameters have NOT changed, so it is the same
as running this statement:

Update SomeTable Set FirstName = 'Peter' where (Id Is Null or Id = 12345)
and (FirstName is null or FirstName = 'Jack')

And herein lies the rub: There is no longer a row in the table where id =
12345 and FirstName = 'Jack' becuase it has been changed to 'John'

So what I REALLY need to know is how to get those parameters to change to
the current values prior to calling the .update on the dataadapter.

Does anyone know how THIS can be accomplished without a ton of manual
maniulatoin?
--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Are you saying that you are doing this:

1. Change the value of FirstName from Jack to John.
2. Call Update on the dataadapter.
3. Call AcceptChanges on the dataadapter.
4. Change the value of FirstName from John to Peter.
5. Call Update on the dataadapter.

And you get a concurrency violation?

Kerry Moorman

"Zorpiedoma n" wrote:
Thanks, but I've already been down that road. The DataSet is behaving
'properly' in that the row shows a unchanged after the first update, then
shows as modified just prior to the second update. The problem is that the
parameter for the updatecommand (which was built using the commandbuilder
method) still holds the ORIGINAL value (Jack, in my example) when it tries to
do the update.

-js
--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Datasets (and datatables and datarows) have an AcceptChanges method for
making the current values the original values.

Kerry Moorman

"Zorpiedoma n" wrote:

> 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.
>
> Example:
>
> I have a dataadapter that contains one table with one row. I change the
> value of the 'FisrtName' column in that row from Jack to John. I call
> .update on the dataadapter it goes through fine. Now I change that same
> column in that same row from John to Peter. Update fails. I'ts because the
> 'origianl' value is still getting passed as the parameter value in the update
> command. In other words, it is looking for a row where firstname = 'Jack'
> and finds none.
>
> How do you get the updated values to become the current values for
> subsequent updates without making an additional run back to the database to
> refresh the whole dataset?
>
> Thanks!
>
>
> --
> --Zorpie

Dec 12 '05 #5
Zorpiedoman,

Here is an example that I just put together. It allows me to update the
"Name" column of the first row (row 0) in a datatable, using a dataadapter, a
commandbuilder, a dataset and a connection. I never get a concurrency
violation and I never need to call AcceptChanges.

Create a Windows Forms project. Place an Update button on the form.

In the form's declarations section:

Dim cn As New
OleDb.OleDbConn ection(("Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
Source=CourseIn fo.mdb;"))
Dim da As New OleDb.OleDbData Adapter("Select * From Students", cn)
Dim cb As New OleDb.OleDbComm andBuilder(da)
Dim ds As New DataSet

In the form's Load event:

'Fill the dataset with data from the database
cn.Open()
da.Fill(ds, "Students")
cn.Close()

In the Update button's click event:

'Display the current value of the "Name" column from row 0 of the
Students datatable
MsgBox(ds.Table s("Students").R ows(0)("Name"))

'Change the value in the "Name" column of row 0 of the Students
datatable
ds.Tables("Stud ents").Rows(0)( "Name") = InputBox("New Student Name?")

'Update the database with changes to the Students datatable
cn.Open()
da.Update(ds, "Students")
cn.Close()

I can repeatedly click the Update button, see the current value in the
"Name" column and change the name.

Is this similar to what you are attempting, or am I misunderstandin g you?

Kerry Moorman

"Zorpiedoma n" wrote:
Almost. There is no acceptchanges on the dataadapter object, but I HAVE
called it on the DataSet that the data adapter fills. It does not matter,
however.

The root of the problem is this: The Update Command, which was built by the
command builder, has a gazillion parameters. It actually checks to find the
exact row it had at the time of filling in order to update.

Let's say my table had only two columns, ID and FirstName. When I call
mydataadapter.f ill(mydataset) the data set is filled. The update command,
built by the command builder, looks something like this:

"Update SomeTable Set FirstName = @p1 Where (ID is null or ID = @p2) and
(FirstName is null or Firstname = @p3)"

After the fill, the parameter values are : @p2 = 12345, @p3 = 'Jack'

I change FirstName from Jack to John and call the update on the dataadapter.

No problem. Database is updated, Datatable is updated, marked unchanged,
etc. All is well.

Then I change FirstName from 'John' to 'Peter' When I call .update on the
dataadapter, the value of the parameters have NOT changed, so it is the same
as running this statement:

Update SomeTable Set FirstName = 'Peter' where (Id Is Null or Id = 12345)
and (FirstName is null or FirstName = 'Jack')

And herein lies the rub: There is no longer a row in the table where id =
12345 and FirstName = 'Jack' becuase it has been changed to 'John'

So what I REALLY need to know is how to get those parameters to change to
the current values prior to calling the .update on the dataadapter.

Does anyone know how THIS can be accomplished without a ton of manual
maniulatoin?
--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Are you saying that you are doing this:

1. Change the value of FirstName from Jack to John.
2. Call Update on the dataadapter.
3. Call AcceptChanges on the dataadapter.
4. Change the value of FirstName from John to Peter.
5. Call Update on the dataadapter.

And you get a concurrency violation?

Kerry Moorman

"Zorpiedoma n" wrote:
Thanks, but I've already been down that road. The DataSet is behaving
'properly' in that the row shows a unchanged after the first update, then
shows as modified just prior to the second update. The problem is that the
parameter for the updatecommand (which was built using the commandbuilder
method) still holds the ORIGINAL value (Jack, in my example) when it tries to
do the update.

-js
--
--Zorpie
"Kerry Moorman" wrote:

> Zorpiedoman,
>
> Datasets (and datatables and datarows) have an AcceptChanges method for
> making the current values the original values.
>
> Kerry Moorman
>
> "Zorpiedoma n" wrote:
>
> > 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.
> >
> > Example:
> >
> > I have a dataadapter that contains one table with one row. I change the
> > value of the 'FisrtName' column in that row from Jack to John. I call
> > .update on the dataadapter it goes through fine. Now I change that same
> > column in that same row from John to Peter. Update fails. I'ts because the
> > 'origianl' value is still getting passed as the parameter value in the update
> > command. In other words, it is looking for a row where firstname = 'Jack'
> > and finds none.
> >
> > How do you get the updated values to become the current values for
> > subsequent updates without making an additional run back to the database to
> > refresh the whole dataset?
> >
> > Thanks!
> >
> >
> > --
> > --Zorpie

Dec 12 '05 #6
Kerry -

Wow. First of all, thank you for working on this so intently. I owe you
one.

The code you lay out here is basically the same. The main differences are
you are using an oleDB data adapter connecting to an access database, I'm
using an MsSql data adapter connecting to SQL server.

I also don't see where you are setting the updatecommand statement for the
data adapter.

Can you do me a favor, if you have not deleted this code yet: can you put a
break point at the da.Update(ds, "Students") line and show me what the
da.updatecomman d.commandtext returns?

Perhaps it is different for an oleDBadapter than it is for a MsSql DA.

Again, thanks!

-zorpie

--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Here is an example that I just put together. It allows me to update the
"Name" column of the first row (row 0) in a datatable, using a dataadapter, a
commandbuilder, a dataset and a connection. I never get a concurrency
violation and I never need to call AcceptChanges.

Create a Windows Forms project. Place an Update button on the form.

In the form's declarations section:

Dim cn As New
OleDb.OleDbConn ection(("Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
Source=CourseIn fo.mdb;"))
Dim da As New OleDb.OleDbData Adapter("Select * From Students", cn)
Dim cb As New OleDb.OleDbComm andBuilder(da)
Dim ds As New DataSet

In the form's Load event:

'Fill the dataset with data from the database
cn.Open()
da.Fill(ds, "Students")
cn.Close()

In the Update button's click event:

'Display the current value of the "Name" column from row 0 of the
Students datatable
MsgBox(ds.Table s("Students").R ows(0)("Name"))

'Change the value in the "Name" column of row 0 of the Students
datatable
ds.Tables("Stud ents").Rows(0)( "Name") = InputBox("New Student Name?")

'Update the database with changes to the Students datatable
cn.Open()
da.Update(ds, "Students")
cn.Close()

I can repeatedly click the Update button, see the current value in the
"Name" column and change the name.

Is this similar to what you are attempting, or am I misunderstandin g you?

Kerry Moorman

"Zorpiedoma n" wrote:
Almost. There is no acceptchanges on the dataadapter object, but I HAVE
called it on the DataSet that the data adapter fills. It does not matter,
however.

The root of the problem is this: The Update Command, which was built by the
command builder, has a gazillion parameters. It actually checks to find the
exact row it had at the time of filling in order to update.

Let's say my table had only two columns, ID and FirstName. When I call
mydataadapter.f ill(mydataset) the data set is filled. The update command,
built by the command builder, looks something like this:

"Update SomeTable Set FirstName = @p1 Where (ID is null or ID = @p2) and
(FirstName is null or Firstname = @p3)"

After the fill, the parameter values are : @p2 = 12345, @p3 = 'Jack'

I change FirstName from Jack to John and call the update on the dataadapter.

No problem. Database is updated, Datatable is updated, marked unchanged,
etc. All is well.

Then I change FirstName from 'John' to 'Peter' When I call .update on the
dataadapter, the value of the parameters have NOT changed, so it is the same
as running this statement:

Update SomeTable Set FirstName = 'Peter' where (Id Is Null or Id = 12345)
and (FirstName is null or FirstName = 'Jack')

And herein lies the rub: There is no longer a row in the table where id =
12345 and FirstName = 'Jack' becuase it has been changed to 'John'

So what I REALLY need to know is how to get those parameters to change to
the current values prior to calling the .update on the dataadapter.

Does anyone know how THIS can be accomplished without a ton of manual
maniulatoin?
--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Are you saying that you are doing this:

1. Change the value of FirstName from Jack to John.
2. Call Update on the dataadapter.
3. Call AcceptChanges on the dataadapter.
4. Change the value of FirstName from John to Peter.
5. Call Update on the dataadapter.

And you get a concurrency violation?

Kerry Moorman

"Zorpiedoma n" wrote:

> Thanks, but I've already been down that road. The DataSet is behaving
> 'properly' in that the row shows a unchanged after the first update, then
> shows as modified just prior to the second update. The problem is that the
> parameter for the updatecommand (which was built using the commandbuilder
> method) still holds the ORIGINAL value (Jack, in my example) when it tries to
> do the update.
>
> -js
>
>
> --
> --Zorpie
>
>
> "Kerry Moorman" wrote:
>
> > Zorpiedoman,
> >
> > Datasets (and datatables and datarows) have an AcceptChanges method for
> > making the current values the original values.
> >
> > Kerry Moorman
> >
> > "Zorpiedoma n" wrote:
> >
> > > 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.
> > >
> > > Example:
> > >
> > > I have a dataadapter that contains one table with one row. I change the
> > > value of the 'FisrtName' column in that row from Jack to John. I call
> > > .update on the dataadapter it goes through fine. Now I change that same
> > > column in that same row from John to Peter. Update fails. I'ts because the
> > > 'origianl' value is still getting passed as the parameter value in the update
> > > command. In other words, it is looking for a row where firstname = 'Jack'
> > > and finds none.
> > >
> > > How do you get the updated values to become the current values for
> > > subsequent updates without making an additional run back to the database to
> > > refresh the whole dataset?
> > >
> > > Thanks!
> > >
> > >
> > > --
> > > --Zorpie

Dec 12 '05 #7
Zorpie,

I modified my code to use SQLClient objects and an SQL Server database. It
still works fine and lets me update the row multiple times.

This line of code uses the commandbuilder to set up the dataadapter's
UpdateCommand:

Dim cb As New OleDb.OleDbComm andBuilder(da)

I don't have my program in front of me at the moment, so I can't try setting
break points, etc.

How are you using the commandbuilder to set up your dataadapter's
UpdateCommand?

Could you post your code that is not working?

Kerry Moorman

"Zorpiedoma n" wrote:
Kerry -

Wow. First of all, thank you for working on this so intently. I owe you
one.

The code you lay out here is basically the same. The main differences are
you are using an oleDB data adapter connecting to an access database, I'm
using an MsSql data adapter connecting to SQL server.

I also don't see where you are setting the updatecommand statement for the
data adapter.

Can you do me a favor, if you have not deleted this code yet: can you put a
break point at the da.Update(ds, "Students") line and show me what the
da.updatecomman d.commandtext returns?

Perhaps it is different for an oleDBadapter than it is for a MsSql DA.

Again, thanks!

-zorpie

--
--Zorpie
"Kerry Moorman" wrote:
Zorpiedoman,

Here is an example that I just put together. It allows me to update the
"Name" column of the first row (row 0) in a datatable, using a dataadapter, a
commandbuilder, a dataset and a connection. I never get a concurrency
violation and I never need to call AcceptChanges.

Create a Windows Forms project. Place an Update button on the form.

In the form's declarations section:

Dim cn As New
OleDb.OleDbConn ection(("Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
Source=CourseIn fo.mdb;"))
Dim da As New OleDb.OleDbData Adapter("Select * From Students", cn)
Dim cb As New OleDb.OleDbComm andBuilder(da)
Dim ds As New DataSet

In the form's Load event:

'Fill the dataset with data from the database
cn.Open()
da.Fill(ds, "Students")
cn.Close()

In the Update button's click event:

'Display the current value of the "Name" column from row 0 of the
Students datatable
MsgBox(ds.Table s("Students").R ows(0)("Name"))

'Change the value in the "Name" column of row 0 of the Students
datatable
ds.Tables("Stud ents").Rows(0)( "Name") = InputBox("New Student Name?")

'Update the database with changes to the Students datatable
cn.Open()
da.Update(ds, "Students")
cn.Close()

I can repeatedly click the Update button, see the current value in the
"Name" column and change the name.

Is this similar to what you are attempting, or am I misunderstandin g you?

Kerry Moorman

"Zorpiedoma n" wrote:
Almost. There is no acceptchanges on the dataadapter object, but I HAVE
called it on the DataSet that the data adapter fills. It does not matter,
however.

The root of the problem is this: The Update Command, which was built by the
command builder, has a gazillion parameters. It actually checks to find the
exact row it had at the time of filling in order to update.

Let's say my table had only two columns, ID and FirstName. When I call
mydataadapter.f ill(mydataset) the data set is filled. The update command,
built by the command builder, looks something like this:

"Update SomeTable Set FirstName = @p1 Where (ID is null or ID = @p2) and
(FirstName is null or Firstname = @p3)"

After the fill, the parameter values are : @p2 = 12345, @p3 = 'Jack'

I change FirstName from Jack to John and call the update on the dataadapter.

No problem. Database is updated, Datatable is updated, marked unchanged,
etc. All is well.

Then I change FirstName from 'John' to 'Peter' When I call .update on the
dataadapter, the value of the parameters have NOT changed, so it is the same
as running this statement:

Update SomeTable Set FirstName = 'Peter' where (Id Is Null or Id = 12345)
and (FirstName is null or FirstName = 'Jack')

And herein lies the rub: There is no longer a row in the table where id =
12345 and FirstName = 'Jack' becuase it has been changed to 'John'

So what I REALLY need to know is how to get those parameters to change to
the current values prior to calling the .update on the dataadapter.

Does anyone know how THIS can be accomplished without a ton of manual
maniulatoin?
--
--Zorpie
"Kerry Moorman" wrote:

> Zorpiedoman,
>
> Are you saying that you are doing this:
>
> 1. Change the value of FirstName from Jack to John.
> 2. Call Update on the dataadapter.
> 3. Call AcceptChanges on the dataadapter.
> 4. Change the value of FirstName from John to Peter.
> 5. Call Update on the dataadapter.
>
> And you get a concurrency violation?
>
> Kerry Moorman
>
> "Zorpiedoma n" wrote:
>
> > Thanks, but I've already been down that road. The DataSet is behaving
> > 'properly' in that the row shows a unchanged after the first update, then
> > shows as modified just prior to the second update. The problem is that the
> > parameter for the updatecommand (which was built using the commandbuilder
> > method) still holds the ORIGINAL value (Jack, in my example) when it tries to
> > do the update.
> >
> > -js
> >
> >
> > --
> > --Zorpie
> >
> >
> > "Kerry Moorman" wrote:
> >
> > > Zorpiedoman,
> > >
> > > Datasets (and datatables and datarows) have an AcceptChanges method for
> > > making the current values the original values.
> > >
> > > Kerry Moorman
> > >
> > > "Zorpiedoma n" wrote:
> > >
> > > > 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.
> > > >
> > > > Example:
> > > >
> > > > I have a dataadapter that contains one table with one row. I change the
> > > > value of the 'FisrtName' column in that row from Jack to John. I call
> > > > .update on the dataadapter it goes through fine. Now I change that same
> > > > column in that same row from John to Peter. Update fails. I'ts because the
> > > > 'origianl' value is still getting passed as the parameter value in the update
> > > > command. In other words, it is looking for a row where firstname = 'Jack'
> > > > and finds none.
> > > >
> > > > How do you get the updated values to become the current values for
> > > > subsequent updates without making an additional run back to the database to
> > > > refresh the whole dataset?
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > --
> > > > --Zorpie

Dec 13 '05 #8
I figured it out!

My Select statement included a calculated column. In my Users table, I have
a column FullName that concatonates the FirstName and LastName fields. As
long as my select statement was "Select ID, FirstName From Users" it worked
fine, just like your code. As soon as I changed the Select statement to
"Select ID, FirstName, FullName From Users" it fails.

That's gotta be because in the database, the FullName field (which was
originally 'Jack Smith') was now 'John Smith' but locally, the value of
FullName was still 'Jack Smith' becuase this won't get updated until you FILL
the DataSet again.

Horay!!!!! Thanks so much for your help. Like I said, I owe you one. Feel
free to contact me directly next time you have a stumper.

-zorpie
Dec 13 '05 #9

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

Similar topics

5
2251
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the DataTable first and I then want to roll through the DataTable while in memory checking for errors and then commit the rows to my database table (btw this is in ASP.NET). Is it possible to have data in a datable before attaching at DataAdapter? I'm a...
2
4249
by: hch | last post by:
dataAdapter.Update(data, "TableName") won’t work! I was about to deploy my first website on the Internet only to discover that the dataAdapter.Update() throws the Server Error in the third underline. It was working fine before. ConnectionString in Web.config: ----------------------------------------- <?xml version="1.0" encoding="utf-8" ?> <configuration>
6
1578
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 from there. I can't find a way to do this. Am I missing something? Much obliged.
13
2085
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 OleDbCommand with an SQL String and the connection it has a DataAdapter with the command then it fills the DataSet's DataTable with the streamed data.
11
2241
by: Siv | last post by:
Hi, I seem to be having a problem with a DataAdapter against an Access database. My app deletes 3 records runs a da.update(dt) where dt is a data.Datatable. I then proceed to update a list to reflect that the 3 items have been deleted only to discover that the 3 items appear, however when I click on them to display their information which runs a datareader over the same database it appears that the data has now gone. I wondered whether...
7
1802
by: Max | last post by:
I've included the needed tables in the DataSource. Those tables that are bound to controls I can workwith. But how do you get access to the DataAdaptors that are not bound? me.Dataset1.table is a table with no Insert or Update methods. pll.DataSet1.table has the Row, ChangeEvent, and ChangeEventHandler. It seems like it should be fairly straight forward to use the DataAdapter without binding it to a control. How do you do this?
6
13998
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection = conn da.UpdateCommand.CommandText = "Update tbl1 set fld1 = 'test' where ID = 1" da.Update(tblx) '--tblx/tbl1 not getting updated here.
3
12510
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 = New SqlCommand da.SelectCommand.Connectoin = conn da.SelectCommand.CommandType = Command.Text da.SelectCommand.CommandText = "insert Into tbl1 Select * from tbl2" da.SelectCommand.ExecuteNonQuery
0
8760
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7872
agi2029
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5923
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2458
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.