当我通过使用水晶报表``error(来源:SQL Server的Microsoft OLE DB提供程序描述:用户'sa'登录失败.SQL状态:42000 ... [英] i got an error when i open automatically a report in pdf by using crystal report "error(Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'sa'. SQL State: 42000...
本文介绍了当我通过使用水晶报表``error(来源:SQL Server的Microsoft OLE DB提供程序描述:用户'sa'登录失败.SQL状态:42000 ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void pARTSSUPPLIEDToolStripMenuItem_Click(object sender, EventArgs e)
{
frmRptList_Parts_Supplied lstpa = new frmRptList_Parts_Supplied();
lstpa.Show();
ReportDocument crReportDocument = new ReportDocument();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
crReportDocument.Load("C://Users//Gilbert//Desktop//softNew//softNew//rptList_Parts.rpt");
crReportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "catalogueReport.pdf");
//Preview the generated PDF
System.Diagnostics.Process.Start(Application.StartupPath + "\\catalogueReport.pdf");
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
crConnectionInfo.ServerName = "GILBERT-PC";
crConnectionInfo.DatabaseName = "dbAutorec";
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "newgt";
}
推荐答案
这应该回答您的问题. http://social.msdn.microsoft.com/论坛/en-US/sqldataaccess/thread/4a58b595-de57-40c4-8924-6f1121bc07b1 [ http://msdn.microsoft.com/en-us/library/ms187885.aspx [ ^ ]
This should answer your question..
http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/4a58b595-de57-40c4-8924-6f1121bc07b1[^]
check sql server error log to confirm it.
http://msdn.microsoft.com/en-us/library/ms187885.aspx[^]
这篇关于当我通过使用水晶报表``error(来源:SQL Server的Microsoft OLE DB提供程序描述:用户'sa'登录失败.SQL状态:42000 ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文