473,382 Members | 1,717 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,382 software developers and data experts.

Really basic question about databinding

I have followed one of the walkthroughs that shows a parameterised query
populating some text boxes that are data bound to a data set. The full
details are found at

http://msdn.microsoft.com/library/de...rizedquery.asp
All this works, however I now want any changes made to the text boxes to be
written back to the db. I know I need the following to write the changes
back to the db:
OleDbDataAdapter1.Update(DsAuthors1, "authors")

However the way to get the values of the text boxes into the dataset seems
cumberson. I have done the following, but surely there must be an easier way
as an association between the dataset/table/field has already been
established.

Dim iPos As Integer

iPos = Me.BindingContext(DsAuthors1, "authors").Position

DsAuthors1.Tables("authors").Rows(iPos)("au_LName" ) = Me.txtAuthorLName.Text

Any Ideas?


Aug 16 '05 #1
2 1212
John,

This is one of the most asked questions in these newsgroups, a line is
pushed down in the datatable by a rowchange. You can force that with an
endcurrentedit of the datasource.

Probably it will be this, before your update

BindingContext(DsAuthors1.Tables, "authors").EndCurrentEdit()

I hope this helps,

Cor
Aug 16 '05 #2
It does,

as ever, many thanks
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
John,

This is one of the most asked questions in these newsgroups, a line is
pushed down in the datatable by a rowchange. You can force that with an
endcurrentedit of the datasource.

Probably it will be this, before your update

BindingContext(DsAuthors1.Tables, "authors").EndCurrentEdit()

I hope this helps,

Cor

Aug 17 '05 #3

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

Similar topics

0
by: rodneybauer1 | last post by:
hello: thanks in advance for any responses. i dont have a isp at home so have to use public library computer. will check this every couple days though. im using visual basic.Net windows XP with...
3
by: Mike Christie | last post by:
I've got some Java experience but no JSP or ASP and am trying to get to grips with ASP.NET. I'd appreciate some help on a simple question. I have been able to get databinding to work, and can...
3
by: Kevin Swanson | last post by:
I'm writing what should be a very simple app against an Oracle database. The app has a number of user controls, any one of which is loaded into a main display page using the loadControl method,...
4
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the...
2
by: Fay Yocum | last post by:
BEWARE beginner questions!! I have some experience in Access but never as much as I want or need. I have decided to get in on VB.Net. I would only rate myself in Access as a...
131
by: pemo | last post by:
Is C really portable? And, apologies, but this is possibly a little OT? In c.l.c we often see 'not portable' comments, but I wonder just how portable C apps really are. I don't write...
5
by: Aussie Rules | last post by:
Hi, Having a mental block on this one. Have done it before but can't rack my brain on how... I have an object, with a bunch on property, and I add that object to a combo box. I want the...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
8
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.