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

Simple ADO.Net Recordset.

My background is in MS Access and I am in the process of migrating my
skillsets to Visual Basic.Net. So far I am able to display data in
DataGridViews and Combo Box, etc with not problem. What I'm not so sure about
is bullding a recordset so that I can iterate through the record set and
perform tasks. I guess this would be a dataset or a table adapter. How would
I basically achieve a code module that does the same as the code below?

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "stored procedure/table", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
Do Until rst.EOF
rst.AddNew
' Add, edit, delete or just read data here.
rst.Update
rst.Delete
rst.MoveNext
Loop

This is how I step through records from Access using SQL Server. How would I
achieve basically the same thing in Visual Basic.Net? Or, can someone provide
a simple snapshot of the equivilant for VB.Net?

Thank you.
Aug 31 '07 #1
4 7028
I guess that letting VB convert your VB6 project automatically is the
smartest thing you could do.
Select "open" in the file menu, then choose your existing VB6 project
that contains the code you want to have converted.
Cheers,
Dieter
Sep 1 '07 #2

"Greg" <Ac**********@newsgroups.nospamwrote in message
news:DB**********************************@microsof t.com...
My background is in MS Access and I am in the process of migrating my
skillsets to Visual Basic.Net. So far I am able to display data in
DataGridViews and Combo Box, etc with not problem. What I'm not so sure
about
is bullding a recordset so that I can iterate through the record set and
perform tasks. I guess this would be a dataset or a table adapter. How
would
I basically achieve a code module that does the same as the code below?

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "stored procedure/table", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
Do Until rst.EOF
rst.AddNew
' Add, edit, delete or just read data here.
rst.Update
rst.Delete
rst.MoveNext
Loop

This is how I step through records from Access using SQL Server. How would
I
achieve basically the same thing in Visual Basic.Net? Or, can someone
provide
a simple snapshot of the equivilant for VB.Net?

Thank you.
There's a couple of zillion out there.
Are you using VB 2005 Express or Std/Pro? Or something else?
When you start up the IDE ...
"Getting Started" box select "How Do I ...?" and select Data Access.

Here is a quick snapshot:
http://asp.dotnetheaven.com/howto/do...employees.aspx

Standard Warning! ADO.Net looks like ADO, but it ain't. Don't make
assumptions. Treat it like a new ballgame. <g>

hth
-ralph
Sep 1 '07 #3
On Aug 31, 9:00 pm, "Ralph" <nt_consultin...@yahoo.comwrote:
"Greg" <AccessVBA...@newsgroups.nospamwrote in message

news:DB**********************************@microsof t.com...
My background is in MS Access and I am in the process of migrating my
skillsets to Visual Basic.Net. So far I am able to display data in
DataGridViews and Combo Box, etc with not problem. What I'm not so sure
about
is bullding a recordset so that I can iterate through the record set and
perform tasks. I guess this would be a dataset or a table adapter. How
would
I basically achieve a code module that does the same as the code below?
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "stored procedure/table", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
Do Until rst.EOF
rst.AddNew
' Add, edit, delete or just read data here.
rst.Update
rst.Delete
rst.MoveNext
Loop
This is how I step through records from Access using SQL Server. How would
I
achieve basically the same thing in Visual Basic.Net? Or, can someone
provide
a simple snapshot of the equivilant for VB.Net?
Thank you.

There's a couple of zillion out there.
Are you using VB 2005 Express or Std/Pro? Or something else?
When you start up the IDE ...
"Getting Started" box select "How Do I ...?" and select Data Access.

Here is a quick snapshot:http://asp.dotnetheaven.com/howto/do...employees.aspx

Standard Warning! ADO.Net looks like ADO, but it ain't. Don't make
assumptions. Treat it like a new ballgame. <g>

hth
-ralph
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "stored procedure/table", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
Do Until rst.EOF
rst.AddNew
' Add, edit, delete or just read data here.
rst.Update
rst.Delete
rst.MoveNext
Loop
Dim conn as new SqlConnection(connectionString)
Dim comm as new SqlCommand(query,conn)
Dim reader as SqlDataReader= comm.ExecuteReader()

dim variable as string

while reader.read
variable = reader("ColumnName")

end while

'use this for an query that is not a select

comm.CommandText = "Update table set values('" + value +"'"
comm.ExecuteNonQuery

The reader allows you forward only access to a recordset.

Use a datatable or dataset for a disconnected very intuitive model of
a database or a databasetable.

Sep 1 '07 #4
Hi Greg,

I'm reviewing this post and would like to know the status of this issue.

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Sep 5 '07 #5

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

Similar topics

1
by: C L Humphreys | last post by:
Hi, I've managed to create a string SQL query taken from a series of comboboxes, tickboxes and textboxes, this is created when an actionbutton is pressed. The question is, how can I display...
5
by: deko | last post by:
I use a For Each... Next loop like this: For Each varFnm In Array("This", "That", "OtherThing", "Foo", "Bar") RunSql ("UPDATE.... bla bla bla) Next But the exact same elements of the Array...
3
by: Bob C. | last post by:
When I migrated my tables to SQL Server I needed a way to overcome the slow performance of the Find method on my recordsets. Although this can be done by accessing the table directly using dao and...
0
by: Freebase | last post by:
Something changed recently on our W2K SP4 machine when we installed INTERSOLV ODBC software... the following script just opens a connection to an MS-Access DB, gets a record then tears down the...
5
by: Stephanie_Stowe | last post by:
Hi. I am trying to get used to AS.NET. I have been doing ASP classic for years, and am now in a position to do ASP.NET. I am in the stumbling around until I get my bearings phase. I hope you will...
12
by: jimfortune | last post by:
I have a question based somewhat on: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/ddde992b84f762bd/152bbc027bf00720?hl=en#152bbc027bf00720 A local table works well...
11
by: Geagleeye | last post by:
Hi, Im a rookie in vba, and therefor got a problem. i do have folwing records F G --------------- 2 3 2 5 6 7
15
by: gjoneshtfc | last post by:
Hello, I have a simple problem that I just cannot get my head around! I currently have the following line in my ASP recordset: Recordset1.Source = "SELECT * FROM MainTable ORDER BY Price ASC"...
9
by: =?Utf-8?B?S2VsbHk=?= | last post by:
I am from classic asp and learning asp.net. In the past, once I have a recordset retrieved, I can use it wheneve and wherever I want. For example, I know my recordset contains something like...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.