473,506 Members | 17,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

no display of DataGrid table in WebForm

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 1208

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

Similar topics

6
2655
by: rodchar | last post by:
Hey all, I have an array of data rows that when I bind it to a datagrid it shows all those extra rows in addition to my fields. How do I hide those fields? I tried using the TableStyles...
4
2392
by: Bill Todd | last post by:
Is there any way to display the RowState of each row in a computed column in the DataTable? -- Bill
8
1914
by: Inigo Jimenez | last post by:
I have an ASP .net web application installed in a Windows 2003 server. This web application has a webform that has a Datagrid. This Datagrid is filled with the data of a SQL table. I have a...
2
2016
by: Marty McDonald | last post by:
When setting certain datagrid properties with the IDE (as in the property window), they don't seem to take effect. For instance, Font Name. So I have to set these via code-behind at the cell...
1
1219
by: Mervin Williams | last post by:
I placed a datagrid on my webform, set the datasource to a datareader, and bound the reader to the datagrid. However, my datagrid does not display. Here is my code from the Page_Load method: ...
2
3170
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
1
1577
by: NH | last post by:
Hi, I'm struggling to display an image on asp.net webform (vb.net). The image is stored in a image field in a sql server database. I have read a good few solutions to it and still havnt got it...
0
1073
by: Jonathan L. | last post by:
I've got a relatively simple scenario that I haven't been able to solve in ASP 2.0. Let's assume I have a simple foreign key relationship as demonstrated below: ------------------- ...
0
1088
by: DC Gringo | last post by:
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...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
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
7307
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,...
1
7021
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...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.