datgrid binding

Posted on 2004-11-15
Last Modified: 2010-04-23
I have Storedprocedure named (employee_select) I want to use this storedprocedure to fill datagrid through datasource how to do that ?
Question by:Prof_MAM
    1 Comment
    LVL 4

    Accepted Solution

    Hi, easy buddy,
    Sub Page_load()
    Dim MySqlConnection As SqlClient.SqlConnection
                MySqlConnection = New SqlClient.SqlConnection(DataPath here)

                Dim MySQLCommand As SqlCommand = New SqlCommand(employee_select, MySqlConnection)
                MySQLCommand.CommandType = CommandType.StoredProcedure

                Dim MySQLDataAdapter As SqlDataAdapter = New SqlDataAdapter(MySQLCommand)

                Dim results As DataSet = New DataSet
                Your_data_grid.DataSource= results
    End Sub

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now