Link to home
Start Free TrialLog in
Avatar of jjc9809
jjc9809

asked on

Loading a Grid View with Temporary Table using web services

Hi Everybody,

I am new to the web and web services.  I need to load a gridview from a temporary table which is determined bya Stored Procedure.  How do you pull data from the temporary table and fill a gridview when the application is being used by web services?

I have attached a copy of the web configuration file and the Stored Procedure.  I have a new web page I have created called Movement.aspx.  Do I do the HTML coding for the gridview in the design view of the Movement.aspx page or does it need to be done in an asmx page?

Also, where does the VB Coding go?  Do I place this coding in the Movement.aspx.vb?
Do I connect the gridview to the IMAS Connection String in the web config file?

Any help is appreciated.
SP.Doc
webConfig.doc
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Think of them as 2 seperate entities:

The Web service is responsible for providing the data.  That's it.

So your web service would have code that allows any progam to call it's function.  from there the function would execute the stored proc with any parameters and return a datatable or something.


Your web PAge (ASPX + VB) is responsible for retreiving data from a source, and displaying that in a grid view.

So your ASPX would have the HTML markup.
The ASPX.VB would have the funtionality of calling the web service, getting the data, and binding it to the grid view.

Hope that helps.
Avatar of jjc9809
jjc9809

ASKER

GED325,

Thanks for the information.  This information will be very helpful to me.

Please find my attached  VB coding for the gridview.

Does this coding look like it might work.  The STored Procedure call, what do I place in the vb coding to call this stored procedure to load the gridview?

My Coding:

Imports System.Web
Imports System.Collections
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration

Public Class Movement1
    Inherits System.Web.Services.WebService

Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Dim da As SqlDataAdapter

Public WebService()
[Web Method]

Public DataSet GetMovementA()
String Query = String.Empty
Query = ‘Select * From tblMovement
Con.Open()
da = New SqlDataAdapter(Query, Con)
DataSet gvMovement = NewDataset()
Da.Fill(gvMovement)
Con.Close()
Return gvMovement
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial