473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

no display of DataGrid table

I am trying to output simply DataGrid of a coutry listing on a web form via
a business object and XML web service...I receive no errors but no table
HTML either. (I know the service and business object is producing data
because it works in a Windows form application).

Here is my WebForm:
----------------------------------------

<%@ Register TagPrefix="allLevels" TagName="mainHeader"
Src="mainHeader.ascx" %>
<%@ Register TagPrefix="allLevels" TagName="secondHeader"
Src="secondHeader.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="index.aspx.vb"
Inherits="LisExplorerV1.index1"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
....stuff
</HEAD>
<body MS_POSITIONING="GridLayout">

<allLevels:mainHeader runat="server" id="mainHeader" />
<allLevels:secondHeader runat="server" id="secondHeader" />

<asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 208px; POSITION:
absolute; TOP: 224px" runat="server" DataSource="<%# CountryData %>"
DataMember="OrgCntry">
</asp:DataGrid>
</body>
</HTML>

Here is my WebForm's CodeBehind File
-----------------------------------

Public Class index1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.CountryData = New
LisExplorerV1.LISXMLWebServiceReference.countries1
CType(Me.CountryData,
System.ComponentModel.ISupportInitialize).BeginIni t()
'
'CountryData
'
Me.CountryData.DataSetName = "countries1"
Me.CountryData.Locale = New
System.Globalization.CultureInfo("en-US")
CType(Me.CountryData,
System.ComponentModel.ISupportInitialize).EndInit( )

End Sub
Protected WithEvents CountryData As
LisExplorerV1.LISXMLWebServiceReference.countries1
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

End Class


Here is my .asmx.vb file:
------------------------------------

Imports System.Web.Services

<System.Web.Services.WebService( _
Namespace:="http://LISExplorer/XMLWebServices", _
Description:="A set of Web Services for the LIS Explorer v1.0")> _
Public Class XMLWebServices
Inherits System.Web.Services.WebService
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Friend WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter

<WebMethod()> Public Function GetCountries() As Countries1
Dim countries As New countries1
SqlDataAdapter1.Fill(countries)
Return countries
End Function

#Region " Web Services Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Web Services Designer.
InitializeComponent()

'Add your own initialization code after the InitializeComponent()
call

End Sub

'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
Friend WithEvents Countries1 As LISExplorerV1WS.countries1
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.Countries1 = New LISExplorerV1WS.countries1
CType(Me.Countries1,
System.ComponentModel.ISupportInitialize).BeginIni t()
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT CountryIdx, CountryCode,
CountryName FROM OrgCntry"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation
id=""CIL-094"";packet size=4096;integrated security=SSPI;data source=""c" &
_
"il-094"";persist security info=False;initial catalog=sacdb"
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO OrgCntry(CountryIdx,
CountryCode, CountryName) VALUES (@CountryIdx, @" & _
"CountryCode, @CountryName); SELECT CountryIdx, CountryCode,
CountryName FROM Org" & _
"Cntry"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@CountryIdx",
System.Data.SqlDbType.SmallInt, 2, "CountryIdx"))
Me.SqlInsertCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@CountryCode",
System.Data.SqlDbType.NVarChar, 2, "CountryCode"))
Me.SqlInsertCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@CountryName",
System.Data.SqlDbType.NVarChar, 40, "CountryName"))
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "OrgCntry", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("CountryIdx", "CountryIdx"), New
System.Data.Common.DataColumnMapping("CountryCode" , "CountryCode"), New
System.Data.Common.DataColumnMapping("CountryName" , "CountryName")})})
'
'Countries1
'
Me.Countries1.DataSetName = "countries"
Me.Countries1.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.Countries1,
System.ComponentModel.ISupportInitialize).EndInit( )

End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

#End Region

End Class

Nov 20 '05 #1
0 1083

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kll | last post by:
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data...
18
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
2
by: csgraham74 | last post by:
Hi guys, just wondering if someone could help me a little. i have a piece of xml being returned to my page. This xml can vary depending on criteria that i select and submit. my issue is...
2
by: Stephen | last post by:
Hi, Can a datagrid display be split into 2 rows. for e.g: suppose my resultset has 20 columns and I want to display 10 in the first row and and rest in another so that the display is not kludgy....
3
by: JJ | last post by:
I have a datagrid on my form that displays its data from various tables within a specified dataset. That all works correclty. However, when one cell is selected prior to changed the displayed...
0
by: G .Net | last post by:
Hi I have a question regarding displaying a foreign key in a DataGrid. To explain my question, consider the following: Suppose I have two tables A and B. Table A has the following structure: ...
2
by: hazz | last post by:
With this code, the config file(listed below) opens initially into the datagrid display with only a plus sign '+'. On clicking that, it becomes expanded to; - appsettings add When I click on...
2
by: Cindy | last post by:
Hello. For some reason, I am able to "connect" to the Northwind database whenever I use the wizard; however, when I run the application, my datagrid does not display. Here are the exact steps I...
2
by: harry | last post by:
Hi all, I have a datagrid (language C#) populated using a stored procedure. I want one of the column to display complete name instead of abbreviation. Can I change the display dynamically in the...
2
by: Iain Wilson | last post by:
Hi Can anyone please advise if this is possible and if so how I would go about it (a pointer to an example would be greatly appreciated). Using C# - Web Application I have a DropDownList with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.