找回密码
 立即注册

QQ登录

只需一步,快速开始

Millu

最新发帖
Bella.YuanWyn认证
超级版主   /  发表于:2023-5-6 16:56:17
11#
Millu 发表于 2023-5-6 11:33
请问如何判断数据库是否连接成功了

您好,您使用上面回复的任意一个方法,先创建数据源,创建后再创建数据集,再到使用组件展示数据,预览时就若数据展示就是连接成功,如果有报错,可以根据报错信息具体看看。
回复 使用道具 举报
Millu
注册会员   /  发表于:2023-5-6 16:58:31
12#
Bella.Yuan 发表于 2023-5-6 16:56
您好,您使用上面回复的任意一个方法,先创建数据源,创建后再创建数据集,再到使用组件展示数据,预览时 ...

请问,错误明细:
GrapeCity.ActiveReports.ReportException: 一个意料之外的问题发生了。 其他信息:“ORA-12541: TNS: 无监听程序” ---> Oracle.ManagedDataAccess.Client.OracleException: ORA-12541: TNS: 无监听程序 ---> OracleInternal.Network.NetworkException: ORA-12541: TNS: 无监听程序 ---> System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:1521
   在 System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
   在 System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   在 OracleInternal.Network.TcpTransportAdapter.ConnectIterate()
   --- 内部异常堆栈跟踪的结尾 ---
   在 OracleInternal.Network.OracleCommunication.DoConnect(String tnsDescriptor)
   在 OracleInternal.Network.OracleCommunication.Connect(String tnsDescriptor, Boolean doNAHandshake, String IName, ConnectionOption CO)
   在 OracleInternal.ServiceObjects.OracleConnectionImpl.Connect(ConnectionString cs, Boolean bOpenEndUserSession, OracleConnection connRefForCriteria, String instanceName)
   --- 内部异常堆栈跟踪的结尾 ---
   在 OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)
   在 OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch)
   在 OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria)
   在 Oracle.ManagedDataAccess.Client.OracleConnection.Open()
   在 GrapeCity.ActiveReports.Rendering.DataProcessing.RecordsAdapter.<GetEnumerator>d__7.MoveNext()
   在 GrapeCity.Enterprise.Data.DataEngine.Extensions.EnumerableExtensions.MemoizedReadOnlyList`1.CacheItem()
   在 GrapeCity.Enterprise.Data.DataEngine.Extensions.EnumerableExtensions.MemoizedReadOnlyList`1.<GetEnumerator>d__6.MoveNext()
   在 System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   在 GrapeCity.ActiveReports.Rendering.ReportDataProcessor.GetRecordSet(IList`1 finalizers, BuildCommandFn buildCommandFn, DataParameter[] parameters, IDataSet dataSet, IExpressionContext expressionContext, CancellationToken token, IDictionary`2 recordSetsCache)
   在 GrapeCity.ActiveReports.Rendering.ReportDataProcessor.<>c__DisplayClass2_0.<MakeRecordSetFn>b__0(RecordSetKey key)
   在 GrapeCity.ActiveReports.Rendering.Tools.FuncExtensions.<>c__DisplayClass0_0`2.<Memoize>b__0(T x)
   在 GrapeCity.Enterprise.Data.DataEngine.DataProcessing.RecordSetProvider.GetDataSet(String name, DataParameter[] parameters)
   在 GrapeCity.Enterprise.Data.DataEngine.DataProcessing.DataProcessor.<>c__DisplayClass13_0.<MakeDataSetFn>b__2(ExecutionContext exc)
   在 GrapeCity.Enterprise.Data.DataEngine.DataProcessing.DataProcessor.<>c__DisplayClass17_1.<MakeScopeFn>b__4(RegionFn fn)
   在 System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   在 System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   在 System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   在 GrapeCity.Enterprise.Data.DataEngine.DataProcessing.DataProcessor.<>c__DisplayClass17_1.<MakeScopeFn>b__3()
   在 GrapeCity.Enterprise.Data.DataEngine.DataTree`1.Scope.get_Regions()
   在 GrapeCity.Enterprise.Data.DataEngine.DataProcessing.DataTreeGenerator.<>c__DisplayClass17_1.<MakeScopeFn>b__5()
   在 GrapeCity.Enterprise.Data.DataEngine.DataTree`1.Scope.get_Regions()
   在 GrapeCity.ActiveReports.Rendering.Data.DataScopeBase.GetRegion(String name)
   在 GrapeCity.ActiveReports.Rendering.Components.RenderReportItemFactory.Create(IReportRenderingContext reportRenderingContext, ReportItem rdlItem, IDataScopeInternal currentDataContext)
   在 GrapeCity.ActiveReports.Rendering.ReportRenderingContext.<>c__DisplayClass65_0.<CreateReportItems>b__0(ReportItem item)
   在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   在 System.Linq.Enumerable.<ConcatIterator>d__59`1.MoveNext()
   在 System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   在 System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   在 System.Linq.Enumerable.<SelectIterator>d__5`2.MoveNext()
   在 System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   在 System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   在 GrapeCity.ActiveReports.Layout.L2.CanvasImpl.BuildGraph[T](IEnumerable`1 canvasItems)
   在 GrapeCity.ActiveReports.Layout.L2.Canvas(IEnumerable`1 canvasItems, Boolean galleyMode, Object item, Int32 width, Int32 height, Boolean consumeWhiteSpace)
   在 GrapeCity.ActiveReports.Layout.L2.Canvas(IEnumerable`1 canvasItems, Boolean galleyMode, Object item, Int32 width, Int32 height, Boolean canShrink, Boolean canGrow, Boolean consumeWhiteSpace)
   在 GrapeCity.ActiveReports.Layout.ReportCanvasLayout.Canvas(IEnumerable`1 items, LayoutScope context, Object item, Int32 width, Int32 height, Boolean canShrink, Boolean canGrow, Boolean consumeWhiteSpace)
   在 GrapeCity.ActiveReports.Layout.ReportImpl.BodyLayout(LayoutScope context, IBody body, Object item, Size`1 contentSize, Nullable`1 size, Boolean consumeWhiteSpace, Nullable`1 isFpl)
   在 GrapeCity.ActiveReports.Layout.LayoutEngine.BuildPages(LayoutScope context, Int32 limit)
   在 GrapeCity.ActiveReports.Layout.LayoutEngine.BuildLayout(LayoutInfo layoutInfo)
   在 GrapeCity.ActiveReports.Viewer.Win.Rdlx.GraphicsRenderingExtension.GetLayoutTree(IReport report, ITargetDevice targetDevice, ITextMetricsProvider metricsProvider, LayoutNotificationCallback callback)
   在 GrapeCity.ActiveReports.Viewer.Win.Rdlx.GraphicsRenderingExtension.Render(IReport report)
   在 GrapeCity.ActiveReports.Viewer.Win.Rdlx.GraphicsRenderingExtension.Render(IReport report, StreamProvider streams, NameValueCollection settings)
   在 GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, Boolean forceDataRefresh, Boolean forceParameterDataRefresh, CancellationToken token)
   --- 内部异常堆栈跟踪的结尾 ---
   在 GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, Boolean forceDataRefresh, Boolean forceParameterDataRefresh, CancellationToken token)
   在 GrapeCity.ActiveReports.Viewer.Win.Rdlx.RdlReport.<>c__DisplayClass22_0.<LoadImpl>b__5()
   在 System.Threading.Tasks.Task.InnerInvoke()
   在 System.Threading.Tasks.Task.Execute()
这种报错怎么处理
回复 使用道具 举报
Felix.LiWyn认证
超级版主   /  发表于:2023-5-6 17:20:42
13#
Millu 发表于 2023-5-6 16:58
请问,错误明细:
GrapeCity.ActiveReports.ReportException: 一个意料之外的问题发生了。 其他信息:“O ...

看情况是您没有装Oracle.ManagedDataAccess
您nuget 装一下Oracle.ManagedDataAccess
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部