C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to fill MSHFlexGrid from Access Database


Posted Date: 19 Aug 2008      Total Responses: 1

Posted By: Dharmendra Banoliya       Member Level: Silver     Points: 1


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



Responses

Author: Kundan Kumar Sinha    22 Aug 2008Member Level: GoldRating:     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
You must Sign In to post a response.
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   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use