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

SImple ADO.Net problem

Set up a simple ADO.Net Windows app. Set everything up... fill data via

************************************************** *****************
Dim bmb As BindingManagerBase

:

:

Private Sub MemberDetail_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me.daTrain.Fill(dsTrain.tblMaster)

bmb = Me.BindingContext(dsTrain.tblMaster)

End Sub

************************************************** *****************

Simple form with 3 text boxes representing three particular fields in the
table via data binding to appropriate fields.

Run App....

First record appears in text boxes as expected. so far so good....

Created a "Move Next Button via:

************************************************** *****************

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

bmb.Position += 1

End Sub

************************************************** *****************

Click button ... and... nothing. Can't get the record position to move on
the form.

So what stupid, simple thing am I overlooking??????

--
Frank Bachman
(Grumpy Aero Guy)

Feb 11 '06 #1
3 994
CMM
Your controls are probably not using that same bindingcontext. Try

bmb = Me.BindingContext(dsTrain, "tblMaster")
This returns a *different* binding manager than
BindingContext(dsTrain.tblMaster) believe it or not and it's probably the
one your controls are using.

Suggestion:
Because of BindingContext/BindingManager's trickyness... I have found it
infinitely helpful to use a DataView and bind to that rather than binding to
the dataset tables directly. It's simple, just drop a DataView onto your
form, associate it with the table, and change all your binding to use the
DataView.

Using DataViews solves all the confusing nuances with databinding.
--
-C. Moya
www.cmoya.com
"Grumpy Aero Guy" <fbachman@beer_me.com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
Set up a simple ADO.Net Windows app. Set everything up... fill data via

************************************************** *****************
Dim bmb As BindingManagerBase

:

:

Private Sub MemberDetail_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me.daTrain.Fill(dsTrain.tblMaster)

bmb = Me.BindingContext(dsTrain.tblMaster)

End Sub

************************************************** *****************

Simple form with 3 text boxes representing three particular fields in the
table via data binding to appropriate fields.

Run App....

First record appears in text boxes as expected. so far so good....

Created a "Move Next Button via:

************************************************** *****************

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

bmb.Position += 1

End Sub

************************************************** *****************

Click button ... and... nothing. Can't get the record position to move on
the form.

So what stupid, simple thing am I overlooking??????

--
Frank Bachman
(Grumpy Aero Guy)

Feb 11 '06 #2
I changed it to xxxxx, "tblMaster" instead of xxxxx.tblmaster....

YOU WERE RIGHT....

Geez.... a little touchy I think.

I will research the dataview component.

Thank you !!!!!!!!!!

--
Frank Bachman
(Grumpy Aero Guy)
"CMM" <cm*@nospam.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
Your controls are probably not using that same bindingcontext. Try

bmb = Me.BindingContext(dsTrain, "tblMaster")
This returns a *different* binding manager than
BindingContext(dsTrain.tblMaster) believe it or not and it's probably the
one your controls are using.

Suggestion:
Because of BindingContext/BindingManager's trickyness... I have found it
infinitely helpful to use a DataView and bind to that rather than binding
to the dataset tables directly. It's simple, just drop a DataView onto
your form, associate it with the table, and change all your binding to use
the DataView.

Using DataViews solves all the confusing nuances with databinding.
--
-C. Moya
www.cmoya.com
"Grumpy Aero Guy" <fbachman@beer_me.com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
Set up a simple ADO.Net Windows app. Set everything up... fill data via

************************************************** *****************
Dim bmb As BindingManagerBase

:

:

Private Sub MemberDetail_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me.daTrain.Fill(dsTrain.tblMaster)

bmb = Me.BindingContext(dsTrain.tblMaster)

End Sub

************************************************** *****************

Simple form with 3 text boxes representing three particular fields in the
table via data binding to appropriate fields.

Run App....

First record appears in text boxes as expected. so far so good....

Created a "Move Next Button via:

************************************************** *****************

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

bmb.Position += 1

End Sub

************************************************** *****************

Click button ... and... nothing. Can't get the record position to move on
the form.

So what stupid, simple thing am I overlooking??????

--
Frank Bachman
(Grumpy Aero Guy)


Feb 12 '06 #3
CMM
Yeah. Watch out this other non-intuitive "gotcha" below (but don't let these
"gotcha's" discourage you, once you wrap your mind around them, databinding
is extremely beneficial... and full-featured).

For instance, using a Datagrid:

DataSource=MyDataset1, DataMemeber=Table1
or
DataSource=MyDataset1.Table1

accomplish the same thing but produce DIFFERENT binding managers. Don't ask
me why. It leads to confusion when you try to create a Master/Details user
interface and then you can't figure out why your Details controls (textboxes
and stuff) don't sync up with your Master control (Datagrid for example)...
it's because behind the scenes they're using different CurrencyManagers.

Again, binding everything to DataView(s) simplies everything greatly. Plus
DataViews add additional features that Datasets don't possess. I like to
make it a "standard practice" to exclusively using binding with DataViews
rather than to the Dataset directly.

--
-C. Moya
www.cmoya.com
Feb 12 '06 #4

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

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
18
by: Sender | last post by:
Yesterday there was a very long thread on this query. (You can search on this by post by 'sender' with subject 'Simple Problem' post date Oct 7 time 1:43p) And in the end the following code was...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
2
by: Vitali Gontsharuk | last post by:
Hi! I have a problem programming a simple client-server game, which is called pingpong ;-) The final program will first be started as a server (nr. 2) and then as a client. The client then...
8
by: rdrink | last post by:
I am just getting into pysqlite (with a fair amount of Python and MySQL experience behind me) and have coded a simple test case to try to get the hang of things... yet have run into a 'stock...
5
by: Chelong | last post by:
hey,the follow is the text file content ========================================apple====pear== one Lily 7 0 0 7 7 two Lily 20 20 6.6666 20 8 one Lily 0 10 2.85 4 0 two Lily 22 22 7.33326 2 5 ...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.