473,387 Members | 1,760 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.

Web Forms Single Record Data Navigation

Hello all - I've been working in VB6 for about a year and
now I've moved "up" to VB.NET. I think I would have fewer
problems in learning vb.net if I knew nothing about
previous versions of vb...

I have spent a long time now trying to figure out how to
move from one record to another in a vb.net application.
For some reason, Microsoft is big on using Datagrids and
DataTables and so all of their examples cover how to
display the entire contents of a dataset at one time. I,
of course, don't want that - after much hunting, I finally
found the command to navigate from one record to the next
in a dataset - me.bindingcontext

I was ecstatic - finally I could do what I needed to - all
I had to do was use the same code into a Web
Application... :(

Of course, there is no bindingcontext object for a web
application because the entire contents of the dataset is
copied to the client (apparently...) and so there is no
specific position property to reference.

I have been reading and searching online once again and
have only been able to find a rather simplistic reference
in MSDN that you just have use the dataset to change which
record is being displayed - but no reference to how to
actually do that.

Can anyone help me? It is such a simple thing, I just
don't seem to be able to think of the right word to seach
by.

In the old days, using vbscript, I would just
dim rs
set rs = CreateObject("ADODB.recordset")
rs.open """""
rs.movenext
rs.movelast, etc, etc.

I can bind all of my controls to the appropriate text
boxes, I figured out the Page.DataBind() method to execute
the binding at run-time, everything works, I just can't
move any other record other than the first one in the
dataset.

Can somebody please help me?

Thanks,
Trevor
Nov 20 '05 #1
1 1511
Trevor:

"I feel your pain" - believe me. I didn't know VB6, I taught myself VB.NET
after programming in FoxPro-DOS for quite some time - always wished I knew
VB6 so who knows who has it easier!?

(FYI: Gartner Research says it takes a COBOL programmer 12-18 months to
learn the new stuff.)

Anyhow I was able to address single records as follows in this example:

result = mycommand.executereader(params) - loads "result" with a dataset
from somewhere (SQL,etc)

while result.read

myIntVar = result.GetInt16(0) * first item returned is an
integer (0)
myStringVar = result.GetString(1) * second item is a string (1)

end while

You can devlop the logic to find a particular record.

I hope that this helps you - KEEP GOING - it IS worth it!

Good Luck,

Fred

"Trevor Fairchild" <Ba*********@aol.com> wrote in message
news:31****************************@phx.gbl...
Hello all - I've been working in VB6 for about a year and
now I've moved "up" to VB.NET. I think I would have fewer
problems in learning vb.net if I knew nothing about
previous versions of vb...

I have spent a long time now trying to figure out how to
move from one record to another in a vb.net application.
For some reason, Microsoft is big on using Datagrids and
DataTables and so all of their examples cover how to
display the entire contents of a dataset at one time. I,
of course, don't want that - after much hunting, I finally
found the command to navigate from one record to the next
in a dataset - me.bindingcontext

I was ecstatic - finally I could do what I needed to - all
I had to do was use the same code into a Web
Application... :(

Of course, there is no bindingcontext object for a web
application because the entire contents of the dataset is
copied to the client (apparently...) and so there is no
specific position property to reference.

I have been reading and searching online once again and
have only been able to find a rather simplistic reference
in MSDN that you just have use the dataset to change which
record is being displayed - but no reference to how to
actually do that.

Can anyone help me? It is such a simple thing, I just
don't seem to be able to think of the right word to seach
by.

In the old days, using vbscript, I would just
dim rs
set rs = CreateObject("ADODB.recordset")
rs.open """""
rs.movenext
rs.movelast, etc, etc.

I can bind all of my controls to the appropriate text
boxes, I figured out the Page.DataBind() method to execute
the binding at run-time, everything works, I just can't
move any other record other than the first one in the
dataset.

Can somebody please help me?

Thanks,
Trevor

Nov 20 '05 #2

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

Similar topics

4
by: Larry Turner | last post by:
I have a form that holds line items in an Order entry project. If the order exist all the line items are changeable. If I want to add a line item it goes to data entry and the item is added, but...
4
by: Larry Turner | last post by:
I have a form that holds line items in an Order entry project. If the order exist all the line items are changeable. If I want to add a line item it goes to data entry and the item is added, but...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
1
by: foothills bhc | last post by:
I have a problem with verifying content of controls on a form before closing the form or moving to the next form "record" (i.e., when moving to the next row of my form's record source). HERE'S THE...
11
by: loyal2uk | last post by:
I have a DB in A2K that handles client's correspondence - based on a table for client details (tblClients) and one for correspondence - (tblLetters) on a one to many relationship.The detailled...
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: 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
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: 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...
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.