473,569 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="allL evels" TagName="mainHe ader"
Src="mainHeader .ascx" %>
<%@ Register TagPrefix="allL evels" TagName="second Header"
Src="secondHead er.ascx" %>
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="ind ex.aspx.vb"
Inherits="LisEx plorerV1.index1 "%>

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

<allLevels:main Header runat="server" id="mainHeader " />
<allLevels:seco ndHeader runat="server" id="secondHeade r" />

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

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

Public Class index1
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.CountryData = New
LisExplorerV1.L ISXMLWebService Reference.count ries1
CType(Me.Countr yData,
System.Componen tModel.ISupport Initialize).Beg inInit()
'
'CountryData
'
Me.CountryData. DataSetName = "countries1 "
Me.CountryData. Locale = New
System.Globaliz ation.CultureIn fo("en-US")
CType(Me.Countr yData,
System.Componen tModel.ISupport Initialize).End Init()

End Sub
Protected WithEvents CountryData As
LisExplorerV1.L ISXMLWebService Reference.count ries1
Protected WithEvents DataGrid1 As System.Web.UI.W ebControls.Data Grid

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

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

#End Region

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

End Class


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

Imports System.Web.Serv ices

<System.Web.Ser vices.WebServic e( _
Namespace:="htt p://LISExplorer/XMLWebServices" , _
Description:="A set of Web Services for the LIS Explorer v1.0")> _
Public Class XMLWebServices
Inherits System.Web.Serv ices.WebService
Friend WithEvents SqlSelectComman d1 As System.Data.Sql Client.SqlComma nd
Friend WithEvents SqlInsertComman d1 As System.Data.Sql Client.SqlComma nd
Friend WithEvents SqlConnection1 As System.Data.Sql Client.SqlConne ction
Friend WithEvents SqlDataAdapter1 As
System.Data.Sql Client.SqlDataA dapter

<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.
InitializeCompo nent()

'Add your own initialization code after the InitializeCompo nent()
call

End Sub

'Required by the Web Services Designer
Private components As System.Componen tModel.IContain er

'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.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.SqlSelectCom mand1 = New System.Data.Sql Client.SqlComma nd
Me.SqlConnectio n1 = New System.Data.Sql Client.SqlConne ction
Me.SqlInsertCom mand1 = New System.Data.Sql Client.SqlComma nd
Me.SqlDataAdapt er1 = New System.Data.Sql Client.SqlDataA dapter
Me.Countries1 = New LISExplorerV1WS .countries1
CType(Me.Countr ies1,
System.Componen tModel.ISupport Initialize).Beg inInit()
'
'SqlSelectComma nd1
'
Me.SqlSelectCom mand1.CommandTe xt = "SELECT CountryIdx, CountryCode,
CountryName FROM OrgCntry"
Me.SqlSelectCom mand1.Connectio n = Me.SqlConnectio n1
'
'SqlConnection1
'
Me.SqlConnectio n1.ConnectionSt ring = "workstatio n
id=""CIL-094"";packet size=4096;integ rated security=SSPI;d ata source=""c" &
_
"il-094"";persist security info=False;init ial catalog=sacdb"
'
'SqlInsertComma nd1
'
Me.SqlInsertCom mand1.CommandTe xt = "INSERT INTO OrgCntry(Countr yIdx,
CountryCode, CountryName) VALUES (@CountryIdx, @" & _
"CountryCod e, @CountryName); SELECT CountryIdx, CountryCode,
CountryName FROM Org" & _
"Cntry"
Me.SqlInsertCom mand1.Connectio n = Me.SqlConnectio n1
Me.SqlInsertCom mand1.Parameter s.Add(New
System.Data.Sql Client.SqlParam eter("@CountryI dx",
System.Data.Sql DbType.SmallInt , 2, "CountryIdx "))
Me.SqlInsertCom mand1.Parameter s.Add(New
System.Data.Sql Client.SqlParam eter("@CountryC ode",
System.Data.Sql DbType.NVarChar , 2, "CountryCod e"))
Me.SqlInsertCom mand1.Parameter s.Add(New
System.Data.Sql Client.SqlParam eter("@CountryN ame",
System.Data.Sql DbType.NVarChar , 40, "CountryNam e"))
'
'SqlDataAdapter 1
'
Me.SqlDataAdapt er1.InsertComma nd = Me.SqlInsertCom mand1
Me.SqlDataAdapt er1.SelectComma nd = Me.SqlSelectCom mand1
Me.SqlDataAdapt er1.TableMappin gs.AddRange(New
System.Data.Com mon.DataTableMa pping() {New
System.Data.Com mon.DataTableMa pping("Table", "OrgCntry", New
System.Data.Com mon.DataColumnM apping() {New
System.Data.Com mon.DataColumnM apping("Country Idx", "CountryIdx "), New
System.Data.Com mon.DataColumnM apping("Country Code", "CountryCod e"), New
System.Data.Com mon.DataColumnM apping("Country Name", "CountryName")} )})
'
'Countries1
'
Me.Countries1.D ataSetName = "countries"
Me.Countries1.L ocale = New System.Globaliz ation.CultureIn fo("en-US")
CType(Me.Countr ies1,
System.Componen tModel.ISupport Initialize).End Init()

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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

#End Region

End Class

Nov 20 '05 #1
0 1093

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

Similar topics

1
2402
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 of the selected row in textboxes on dialog that execute by the user press a button. The following code works if I do not sort the datagrid before I...
18
3329
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 columns, "scode" and "sname", as 1 column (if not possible then 2 columns will be fine) in the listbox. Can the listbox display 2 columns information...
2
1451
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 that when the data is returned i wish to display the result in a table. Im not sure what the best way is to do this. should this be done in a datagrid...
2
1213
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. is it possible? Thanks, Stephen
3
1928
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 table, the cell from the old table remains visible, infront of the new tables data...?! I have tried 'datagrid.refresh', 'DataGrid1.DataSource =...
0
800
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: UID_A ' Primary key of A FK_B ' Foreign key to table B i.e. UID_B
2
2175
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 appsettings, it reverts back to '+' On clicking that, - appsettings add is displayed Finally, when I click on appsettings this time, the contents...
2
2208
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 am taking to try to get this to run: 1)New Project -->ASP.NET Application 2) From the Server Explorer, drag the Northwind Employees table onto...
2
3126
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 datagrid or should I change it in stored procedure?
2
173
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 the following entries Room A Room B All Rooms
0
7701
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
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 we have to send another system
0
940
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.