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

recored set

How to use record set in dotnet2005
Apr 2 '07 #1
1 1033
How to use record set in dotnet2005

The first step to add a reference to the ADO library. You can add reference to the ADO library by using Project->Add Reference menu item and then select COM tab seelct Microsoft ActiveX data Objects 2.7 Library.


After adding this reference, you'll see the ADODB namespace is added to your project

Projects->Reference->ADODB

Import namespace

Expand|Select|Wrap|Line Numbers
  1. Imports System.Data
  2. Imports System.Data.OleDb
  3. Imports ADODB
  4.  
  5.  
  6. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  7. ' Create a connection string
  8. Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\Northwind.mdb"
  9. Dim sql As String = "SELECT CustomerId, CompanyName, ContactName From Customers"
  10.  
  11. Dim rs As _Recordset = conn.Execute(sql)
  12. ' Create dataset and data adpater objects
  13. Dim ds As DataSet = New DataSet("Recordset")
  14. Dim da As OleDbDataAdapter = New OleDbDataAdapter
  15. ' Call data adapter's Fill method to fill data from ADO
  16. ' Recordset to the dataset
  17. da.Fill(ds, rs, "Customers")
  18. ' Now use dataset
  19. DataGrid1.DataSource = ds.DefaultViewManager
  20. End Sub
  21.  
  22.  
  23.  

hope it work
Apr 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rev. Karl E. Taylor | last post by:
Okay, what am I doing wrong here? _____________________________________________________________________________ From oprecs.bas module: Public tapeRec As New HB_Recordset Public Const ttape As...
0
by: shan | last post by:
#include<fstream> #include<iostream> #include<string> #include<iomanip> #include<stdlib.h> #include<conio.h> #include<stdio.h> using namespace std; class library
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
24
by: deko | last post by:
I have an mdb (2002 file format) that uses memo fields extensively. I've read a lot about how problematic memo fields can be and that avoiding them is a good idea. But I'm stuck with them and was...
2
by: Vadim | last post by:
Hi! I imported some table (about 1500 records) using "LOAD DATA LOCAL INFILE..." (command line console). No warnings, no skipped, no deletes - all the recored are written to be imported. However,...
0
by: tkatny | last post by:
How I Include External Input In Recored Macro. I Need The Macro To Pause Two (2) Times In Each Run And Repet Macro 20 Times. Thanks, Tad
4
by: arali | last post by:
when I open my form it show me the frist recored i entered i am using Vb6 How it shows new recored entry when i open a form just like this id:12 ...
7
by: arali | last post by:
I have made a database in Access I made a report criteria form on which i use to datpickers dtpicker0 and dtpicker1 and two command button open button is used to open the report...
7
by: zivon | last post by:
I'm making a form for changing a user password and information and tring to update the recoreds. maybe the problam has nothing to do with what I'm thinking.. but that is what I tried: when I...
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
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: 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...
0
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 project—planning, coding, testing,...

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.