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

What is the code for displaying records in a datagrid?

How can I display my database records in a datagrid?

Can someone help me with these. Im a beginner in vb6
Nov 19 '08 #1
3 1532
missinglinq
3,532 Expert 2GB
Since this is a question about VB 6, I'll move it to the Visual Basic Forum.

Welcome to Bytes!

Linq ;0)>

Moderator
Nov 19 '08 #2
lotus18
866 512MB
There are a lot of ways on how to display records in a datagrid. We have ADODB, ADODC etc.


Rey Sean
Nov 19 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

Open a Connection Object...
and add a DataGrid Control on your form:
Write this code in Form_Load:

Expand|Select|Wrap|Line Numbers
  1. Dim sSQL As String
  2. Dim RST As New ADODB.Recordset
  3. RST.CursorLocation=adUseClient
  4. sSQL = "select * from MyTable"
  5. RST.Open sSQL, con
  6. Set DataGrid1.DataSource = RST
  7.  
Regards
Veena
Nov 20 '08 #4

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

Similar topics

0
by: .Net Sports | last post by:
I'm able to display the lname and fname variables in my datagrid , using the below sql string strSQLQuery = "SELECT fname + ' ' + lname AS Name, cust_id " _ & "FROM tblcusttag " _ & "WHERE...
2
by: VM | last post by:
When I display data to a Windows datagrid I usually fill the underlying table (in another class) and then, once it contains all the data, I attach it to the grid. But there are some processes that...
1
by: sups sups via .NET 247 | last post by:
Hi.. I have two tables one called State and the other called City. State City State_ID City_ID State_Name City_Nm State_ID and so on.. I have created 2 datagrids.
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
3
by: Ben Becker | last post by:
I am trying to build a custom crosstab type of grid where I take some items in a data grid and based on the content of the current item compared to the previous item, determine if a new row in a...
2
by: Bidarkota | last post by:
I need to Display DataGrid Headers and the "no records" message when the DataGrid is empty, is there any way to achieve this. Thank you
0
by: Jyothihathwar | last post by:
Hi Friends, I am displaying data using Datagrid and i have set properties as Allow Pagin = "True" and PageSize as 10.So for ex if there are records then first 10 records will be displayed first...
1
by: sushant2009 | last post by:
Hi , I want to display empty databae table(actually table contains lot of records) to datagrid using dataset and dataadpter. After displaying i will fill new records in datagrid and i will save...
1
by: Deepmala26 | last post by:
Hi, I m doing a project in VB.NET. I've created form and database connectivity is done. I've displayed data in Datagrid through which user can sort and find records. for finding...
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
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.