|
|
|
C# connect db แล้วแต่ยังต้องกรอก password อยู่ค่ะ สามารถเชื่อมต่อฐานข้อมูลได้แล้วค่ะ |
|
|
|
|
|
|
|
ReportDocument rpt =new ReportDocument();
rpt.Load("path Report");
rpt.SetDatabaseLogon("username","password","servername","databasename");
|
|
|
|
|
Date :
2010-05-11 08:11:50 |
By :
anucham |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (VB.NET)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TL As TableLogOnInfo = Report1.Database.Tables(0).LogOnInfo
TL.ConnectionInfo.ServerName = "ITSERVER\SQL2008" // ชื่อserver
TL.ConnectionInfo.DatabaseName = "BaseEvent" //ชื่อฐานข้อมูล
TL.ConnectionInfo.UserID = "sa" // username
TL.ConnectionInfo.Password = "sql2008" //password
Report1.Database.Tables(0).ApplyLogOnInfo(TL)
Report1.Refresh()
CrystalReportViewer1.ReportSource = Report1
End Sub
|
|
|
|
|
Date :
2011-10-19 19:38:27 |
By :
Testprogram |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|