Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 11th, 2013, 10:19 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default populate datagrid using stored proc sql

good day I made a sql procedure to view different columns joined togerther from different table.

i have a problem populating the datagrid

the code i have as of now

Code:
    Dim sCommand As SqlCommand
        Dim sAdapter As SqlDataAdapter
        Dim sBuilder As SqlCommandBuilder
        Dim sDs As DataSet
        Dim sTable As DataTable


        Dim sqlconn As New SqlClient.SqlConnection
        sqlconn.ConnectionString = "server = SKPI-APPS1;" & _
        "Database = EOEMS;integrated security=true"

 Dim cmd As New SqlCommand
        Dim reader As SqlDataReader

        cmd.CommandText = "OfficeEquipmentProfile"
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Connection = sqlconn

        sqlconn.Open()

     

        sAdapter = New SqlDataAdapter(cmd)
        sBuilder = New SqlCommandBuilder(sAdapter)
        sDs = New DataSet
        sAdapter.Fill(sDs, "tblOfficeEquipmentProfile")
        sAdapter.Fill(sDs, "tblDepartment")
        sAdapter.Fill(sDs, "tblLocation")
        sAdapter.Fill(sDs, "tblOfficeEquipmentCategory")
        sAdapter.Fill(sDs, "tblApplication")
        sAdapter.Fill(sDs, "tblApplicationLicense")
        sAdapter.Fill(sDs, "tblEquipmentApplication")
        sAdapter.Fill(sDs, "tblOfficeEquipmentBrand")
        sAdapter.Fill(sDs, "tblOfficeEquipmentModel")
        sAdapter.Fill(sDs, "tblOfficeEquipmentServiceOrder")
        sAdapter.Fill(sDs, "tblOfficeEquipmentPMplan")


        sTable = sDs.Tables("tblOfficeEquipmentProfile")
        sTable = sDs.Tables("tblDepartment")
        sTable = sDs.Tables("tblLocation")
        sTable = sDs.Tables("tblOfficeEquipmentCategory")
        sTable = sDs.Tables("tblApplication")
        sTable = sDs.Tables("tblApplicationLicense")
        sTable = sDs.Tables("tblEquipmentApplication")
        sTable = sDs.Tables("tblOfficeEquipmentBrand")
        sTable = sDs.Tables("tblOfficeEquipmentServiceOrder")
        sTable = sDs.Tables("tblOfficeEquipmentPMplan")

        DataGrid1.DataSource = sDs.Tables("tblOfficeEquipmentProfile, tblDepartment, tblLocation, tblOfficeEquipmentCategory, tblApplication,tblApplicationLicense, tblEquipmentApplication, tblOfficeEquipmentBrand, tblOfficeEquipmentServiceOrder,tblEquipmentPMplan")
        DataGrid1.ReadOnly = True
        'Button1.Enabled = False
        'DataGrid1.SelectionMode = DataGridViewSelectionMode.FullRowSelect


        reader = cmd.ExecuteReader()
        sqlconn.Close()

Last edited by skpiprogrammer; March 11th, 2013 at 10:35 PM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access .mdb calling SQL server 2000 stored proc fazzou Access 6 September 8th, 2006 11:32 AM
Return output variable to VB from SQL stored proc busterbunny BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 27th, 2006 09:24 PM
Calling a T-SQL Stored proc from DTS mepancha SQL Server 2000 1 April 13th, 2005 09:12 AM
sql statements and stored proc. HOW????? xristina MySQL 3 October 24th, 2004 07:12 AM
Inserting using a Stored Proc connection to SQL sanjeet ADO.NET 2 August 11th, 2003 04:33 PM



All times are GMT -4. The time now is 02:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.