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

database to msflexgrid

i have a problem regarding on how to transfer datas from msflexgrid. When i was using datagridview, i just use "Datagridview1.datasource=ds.Tables[0].defaultview;" but it seems, it doesn't work at flexgrid at all. So if anyone could just help me on how can i display data on a msflexgrid, it will surely be a great help..

thanks!
May 16 '07 #1
4 3904
brazel
11
Good day!

Hello,

I want to give some Idea if I can help you this following code.

Dim db As Database
Dim rs As Recordset

Private Sub Form_Load()

MSFlexGrid1.Clear
MSFlexGrid1.Rows = 2
MSFlexGrid1.Cols = 7

Set db = DBEngine.OpenDatabase(App.Path & "\sample.mdb")
Set rs = db.OpenRecordset("table1")
On Error Resume Next ' to ignore the error
rs.MoveFirst ' this line can be error if no records in the table

Do Until rs.EOF
MSFlexGrid1.Row = MSFlexGrid1.Rows - 1

Griddisply

MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
rs.MoveNext
Loop

End Sub

Sub Griddisply()
Dim a As Integer
For a = 0 To 7
MSFlexGrid1.Col = a
MSFlexGrid1 = rs(a)
Next a
End Sub
May 16 '07 #2
Good pm!

i forgot to say that i am using a C# programming language, Can you give me a code in C# that also transfer data from a database to flexgrid?

tnx!




Good day!

Hello,

I want to give some Idea if I can help you this following code.

Dim db As Database
Dim rs As Recordset

Private Sub Form_Load()

MSFlexGrid1.Clear
MSFlexGrid1.Rows = 2
MSFlexGrid1.Cols = 7

Set db = DBEngine.OpenDatabase(App.Path & "\sample.mdb")
Set rs = db.OpenRecordset("table1")
On Error Resume Next ' to ignore the error
rs.MoveFirst ' this line can be error if no records in the table

Do Until rs.EOF
MSFlexGrid1.Row = MSFlexGrid1.Rows - 1

Griddisply

MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
rs.MoveNext
Loop

End Sub

Sub Griddisply()
Dim a As Integer
For a = 0 To 7
MSFlexGrid1.Col = a
MSFlexGrid1 = rs(a)
Next a
End Sub
May 16 '07 #3
brazel
11
Hello,

Sorry I'm not so familiar in C#, I looked at Microsoft Visual C# 2005 Express Edition, I can't see if they have a flixgrid, only Datagridview.
May 16 '07 #4
i just added that component in C#.. wooh! this was really tough! i cannot find anything in the net.. well, thanks anyway! Godbless
May 16 '07 #5

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

Similar topics

0
by: Ed | last post by:
Hi, I am using an MSflexgrid in my c# code. I have a strange problem. My MSflexgrid has only 1 column. Now the data in that column can be long. WIth just 1 column the MSflexgrid does not show...
1
by: PVS | last post by:
Hi, I am new to VC++ 7.0. I want to use MSFlexGrid in my dialog based MFC project in VC++ 7.0 (in VS ..NET IDE). I added the MSFlexGrid control into my resource editor toolbox and I dragged and...
0
by: Martin K | last post by:
Hello all..thanks for everyone's advice regarding my SHBrowseForFolder API problem, I was able to put together a public class that runs great! But I have another migration headache regarding the...
1
by: schapopa | last post by:
Hi, I have a MSFlexGrid control on the SSTab and now I am trying to make it editable. I got some example on the net that explains how to achive that. So I have a text box that appears over the...
1
by: zoneal | last post by:
Hi, I am involved in the process of migrating vb(6.0) application to vb.net. My application contains only vb controls namely MSFLEXGRID. I want to migrate my application to vb.net completely...
1
by: Steven | last post by:
I develop the application which contains MSFlexGrid to display data. When I try to fill the grid with the text data, I want to adjust the column width so that the width is adjusted to the maximum...
0
by: cutecatcher | last post by:
good day! is there anyone that can help to know how to view the data on your database on a msflexgrid? thanks!
5
by: Ishmael | last post by:
Hi Is Been a 3 Yrs Now (I Still trying to do this) Please help me to do this with Visual Basic 6.0 using Msflexgrid Let say you are the Principal . You have 10 educators and 5 class (Grades)...
2
by: JuAn2226 | last post by:
hi,I got few question here. Hope some one can me. plz help me i running out of time 1. how to make my msflexgrid to display data for every 5 min(especially the number car and average speed. ...
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: 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
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
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
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.