C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Visual Studio »

How to fill MSHFlexGrid from Access Database


Posted Date: 19 Aug 2008      Posted By: Dharmendra Banoliya      Member Level: Gold     Points: 1   Responses: 1



I have a access database I want to fill MSHFlexGrid from database.




Responses

Author: Kundan Kumar Sinha    22 Aug 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 6

Hi,

Create a connection string for the Access Database.

Open Connection with that database, declare recordset and execute Select statment,

like,

rs.Open "Select * From TableName", Conn 'Where Conn is active connection

Now add the folowing code

Dim i As Long, j As Long
msflexgrid1.visible = false
msflexgrid1.Cols = rs.Field.Count
msflexgrid1.Rows = rs.RecordCount + 1
Do While Not rs.EOF
i = i + 1 'ignore fixed row
For j = 1 To 10 'ignore fixed column
msflexgrid1.TextMatrix(i, j) = rs.Fields(j)
Next
rs.MoveNext
Loop
msflexgrid.visible = true


Regards,
Kundan



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Difference Betwwen VB.Net and ASP.Net
Previous : how to add combobox in Datagridview controls
Return to Discussion Forum
Post New Message
Category: Visual Studio

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use