去看看cashcho翻译的文章吧
很详细的
http://www.csdn.net/develop/read_article.asp?id=12291
很详细的
http://www.csdn.net/develop/read_article.asp?id=12291
解决方案 »
- 几个微软经典开源的项目源代码
- 无法从“social.Web.Controls.logo”转换为“System.Web.UI.Page”
- 麻烦帮我看下这个问题
- 请问ExecuteNonQuery()对select语句有作用吗?
- 紧急求救??为Gridview绑定值的问题??
- 无法识别的配置节system.webServer 请帮忙
- 穿一个数组参数怎么穿啊?GetRadiobuttonValue({ "no", "is", "isbut" });这样好像不行
- 控件发生位移请教原因
- repeater中的超链接
- aspx不能运行问题,很急
- 在线急等,100分!!!!!!
- 急,求救一个小问题,在线等答案。
http://www.csdn.net/develop/read_article.asp?id=12293
Imports System.Drawing
Public Class WebForm5
Inherits System.Web.UI.Page
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer#Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub 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
BindReport("Select * from test5")
End Sub
Sub BindReport(ByVal SQL As String) Dim myConnection As New SqlClient.SqlConnection() myConnection.ConnectionString = "Persist Security Info=False;User ID=sa;pwd=;Initial Catalog=test;Data Source=crm" Dim MyCommand As New SqlClient.SqlCommand() MyCommand.Connection = myConnection MyCommand.CommandText = SQL MyCommand.CommandType = CommandType.Text Dim MyDA As New SqlClient.SqlDataAdapter() MyDA.SelectCommand = MyCommand
'已建好的DATASET的文件
Dim myDS As New Dataset2()
'This is our DataSet created at Design Time
MyDA.Fill(myDS, "test5")
'You have to use the same name as that of your Dataset that you created during design time
Dim oRpt As New crp3()
' This is the Crystal Report file created at Design Time
oRpt.SetDataSource(myDS)
' Set the SetDataSource property of the Report to the Dataset
CrystalReportViewer1.ReportSource = oRpt ' Set the Crystal Report Viewer's property to the oRpt Report object that we created
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
BindReport("select * from test5 where sz<500")
End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
BindReport("select * from test5")
End Sub
End Class
C#能做到的,VB.NET基本上也能做到,反过来也一样。
用什么语言写程序,一方面看个人的爱好,另一方面也看程序的需要。真正能做到兼收并蓄的,是人,而不是那一种语言。