OrFlying For VB.Net 在Asp.Net中的应用
2006-07-06 14:07
393 查看
引用CGlbDll 和 对象库,然后可以方便的在网页中使用对象层,如下所示:获取所有的Role对象,并且显示RoleName
代码如下所示:
--------------------------------------------------------------------------------------
Imports AgileSoft.CGlbDll
Imports AgileSoft.SysEccLib
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
'注意: 以下占位符声明是 Web 窗体设计器所必需的。
'不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Public xCn As Data.IDbConnection
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not AgileSoft.CGlbDll.CGlbSharedMethods.GetDbConnect(xCn, "sa", "tiankelafei", "wujingmis", "ibm") Then
Me.TextBox1.Text = Me.TextBox1.Text & "连接数据库失败" & vbCrLf
Exit Sub
End If
Dim xColRole As AgileSoft.SysEccLib.CColSysRole
If Not CEngSysRole.GetColSysRoleBySQL(xColRole) Then
Me.TextBox1.Text = Me.TextBox1.Text & "返回对象失败" & vbCrLf
Exit Sub
End If
Dim xClsRole As CClsSysRole
For Each xClsRole In xColRole
Me.TextBox1.Text = Me.TextBox1.Text & xClsRole.RoleName & vbCrLf
Next
End Sub
End Class
运行效果如图:
代码如下所示:
--------------------------------------------------------------------------------------
Imports AgileSoft.CGlbDll
Imports AgileSoft.SysEccLib
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
'注意: 以下占位符声明是 Web 窗体设计器所必需的。
'不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Public xCn As Data.IDbConnection
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Not AgileSoft.CGlbDll.CGlbSharedMethods.GetDbConnect(xCn, "sa", "tiankelafei", "wujingmis", "ibm") Then
Me.TextBox1.Text = Me.TextBox1.Text & "连接数据库失败" & vbCrLf
Exit Sub
End If
Dim xColRole As AgileSoft.SysEccLib.CColSysRole
If Not CEngSysRole.GetColSysRoleBySQL(xColRole) Then
Me.TextBox1.Text = Me.TextBox1.Text & "返回对象失败" & vbCrLf
Exit Sub
End If
Dim xClsRole As CClsSysRole
For Each xClsRole In xColRole
Me.TextBox1.Text = Me.TextBox1.Text & xClsRole.RoleName & vbCrLf
Next
End Sub
End Class
运行效果如图:
相关文章推荐
- OrFlying For VB.NET 使用说明
- OrFlying For VB.Net 下载连接
- The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the ser
- asp.net(vb)中应用ajaxpro.dll的笔记(.net 1.1)。
- Create a DLL by CSharp or VB.Net for VBA--摘自网络
- asp.net(vb)中应用ajaxpro.dll的笔记,之二(.net 1.1)。
- 在asp.net(vb)中,应用ajaxpro.dll操作Session出现错误的解决方法
- ASP.NET弹出页面的应用(VB)
- OrFlying VB.net版代码示例
- 在ASP.net(VB)中一些JAVAScript的应用
- How to use jquery or ajax to update razor partial view in c#/asp.net for a MVC project
- Asp.net开发过程中的几个模式(设计,源,cs or vb)切换
- asp.net mvc 报错 CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default
- Maticsoft.Framework for Asp.Net框架应用实例(一)
- MySqlBackup.NET - MySQL Backup Solution for C#, VB.NET, ASP.NET
- using sql server or sql azure for session state store in asp.net
- ASP.NET Core应用针对静态文件请求的处理[5]: DefaultFilesMiddleware中间件如何显示默认页面
- ASP.NET MVC Model绑定的简单应用
- Bootstrap Pagination for ASP.NET GridView
- asp.net(VB)操作Access数据库(链接/添加/修改/删除)