ConnectionInfo
How do I use Connection Info
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
50 | ConnectionInfo crConnectionInfo = new ConnectionInfo(); | 1 |
794 | EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f); | 2 |
File name: FormBaoCao.cs
Copy
40 private void btnLoc_Click(object sender, EventArgs e)
41 {
42 SqlConnection con = dal.GetConnect();
43 con.Open();
44 string sql = "select *from SinhVien where MaLop=@MaLop";
45 SqlDataAdapter da = new SqlDataAdapter(sql, con);
46 da.SelectCommand.Parameters.AddWithValue("@MaLop", cmbMaLop.SelectedValue.ToString());
47 DataTable dt = new DataTable();
48 da.Fill(dt);
49 crBaoCao cr = new crBaoCao();
50 ConnectionInfo crConnectionInfo = new ConnectionInfo();
51 crConnectionInfo.ServerName = "Ty-PC";
52 crConnectionInfo.DatabaseName = "CNPM_1";
53 crConnectionInfo.UserID = "sa";
54 crConnectionInfo.Password = "04091990";
55 TableLogOnInfos crTableLogonInfos = new TableLogOnInfos();
56 foreach (CrystalDecisions.CrystalReports.Engine.Table table in cr.Database.Tables)
57 {
58 TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();
59 crTableLogonInfo.TableName = table.Name;
60 crTableLogonInfo.ConnectionInfo = crConnectionInfo;
61 crTableLogonInfos.Add(crTableLogonInfo);
62 table.ApplyLogOnInfo(crTableLogonInfo);
63
64 }
65 crvHocKyHocPhan.LogOnInfo = crTableLogonInfos;
66 cr.SetDataSource(dt);
67 ParameterValues a = new ParameterValues();
68 ParameterDiscreteValue b = new ParameterDiscreteValue();
69 b.Value = cmbMaLop.SelectedValue.ToString();
70 a.Add(b);
71 cr.DataDefinition.ParameterFields["txtMaLop"].ApplyCurrentValues(a);
72 crvHocKyHocPhan.ReportSource = cr;
73 crvHocKyHocPhan.Show();
74 }
File name: PhotonEditor.cs
Copy
792 protected virtual void RegisterWithEmail(string email)
793 {
794 EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);
795 var client = new AccountService();
796 client.RegisterByEmail(email, RegisterOrigin); // this is the synchronous variant using the static RegisterOrigin. "result" is in the client
797
798 EditorUtility.ClearProgressBar();
799 if (client.ReturnCode == 0)
800 {
801 PhotonEditor.Current.UseCloud(client.AppId, 0);
802 PhotonEditor.Save();
803 this.ReApplySettingsToWindow();
804 this.photonSetupState = PhotonSetupStates.SetupPhotonCloud;
805 }
806 else
807 {
808 if (client.Message.Contains(CurrentLang.EmailInUseLabel))
809 {
810 this.photonSetupState = PhotonSetupStates.EmailAlreadyRegistered;
811 }
812 else
813 {
814 EditorUtility.DisplayDialog(CurrentLang.ErrorTextTitle, client.Message, CurrentLang.OkButton);
815 // Debug.Log(client.Exception);
816 this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
817 }
818 }
819 }
ConnectionInfo 104 lượt xem
Gõ tìm kiếm nhanh...