I'm currently working in the .NET Entity Framework (MySQL 5.0 server) Windows Forms Application. While trying to print the report in client's system, I'm getting the following error message.
Method Errored:GetEffectiveCulture
Error Message:The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception.
Additional Details: at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.Shared.LocaleManager..ctor()
at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()
at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()
Please help me to solve this error.
i solved this problem using following link
http://www.logicaltrinkets.com/wordpress/?p=213
Check whether the connection string path to the database is correct or not. If any dataset is formed then configure it and check its connections.
Related
I'm writing an API to check if an OU exists in ActiveDirectory or not.
To perform this check, in C#, I run:
string ouName = "MyOrg";
bool ouExists = DirectoryEntry.Exists ($"LDAP://OU={ouName},DC=test,DC=local");
When I create a new CLI project and run these lines, they work fine (the app is running on the DC itself).
But when called by a Controller in a WebAPI project, they throw a runtime COMException (80004005), with the details being "Unspecified error".
I figure this has to do with how Kestrel runs the code. It should authenticate automatically as the current loggedonuser (i.e. I can't use the username, password optional parameters).
How do I do that? And is this the right way to go about it?
Exception details:
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Exists(String path)
at OUCheck.Helpers.ActiveDirectoryHelper.OUExists(String ouDN) in /Projects/OUCheck/Helpers/ActiveDirectoryHelper.cs:line 14
System.Runtime.InteropServices.COMException
The format of the paths for the DirectoryEntry are wrong.
I can't find a supporting document, but the following is the difference:
I was making the queries like this: LDAP://{DN}
LDAP://OU=MyOrg,DC=test,DC=local
While it seems the correct way to do it is: LDAP://{domain}/{DN}
LDAP://test.local/OU=MyOrg,DC=test,DC=local
CLI apps work even with the former, perhaps assuming things about the domain.
The following transcript helped me realize, also thanks to Gabriel for some direction!
https://chat.stackoverflow.com/transcript/12432/2012/6/12
Also might be useful: Get all users from Active Directory?
so basically at work I was assigned an old ASP.NET project which is outdated I have couple of months debugging it. Last week the project was working fine then from one moment to another stopped working. When I run the project I get this exception
System.Data.Entity.Core.ProviderIncompatibleException: 'An error
occurred accessing the database. This usually means that the
connection to the database failed. Check that the connection string is
correct and that the appropriate DbContext constructor is being used
to specify it or find it in the application's config file. See
http://go.microsoft.com/fwlink/?LinkId=386386 for information on
DbContext and connections. See the inner exception for details of the
failure.'
Which also have 2 inner exceptions
ProviderIncompatibleException: The provider did not return a
ProviderManifestToken string.
OracleException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment
specified
What is causing this error?
When I run the project I have a method called LoadUserInfo(); which displays the user code, user department and username to retrieve this data, the application goes to the oracle database and retrieves this info, but for some reason (that I cant figure out) is not working.
Im getting login failed error when trying to connect to my database using NHibernate:
var config = Fluently.Configure()
.Database(MsSqlConfiguration
.MsSql2005
.ConnectionString("Data Source=SERVER1\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=xxx"))
.Mappings(x => x.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));
With Error 18456 State 5 in the log viewer in SQL Management Studio.
But using sqlcmd or Management Studio it works fine (using Windows Auth)!
What could be the problem?
EDIT
The NHibernate exception:
Test method ProjektLogg.Tests.NHibernateTests.ShouldBeAbleToGenerateFactory threw exception:
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
---> NHibernate.HibernateException: Login failed for user XXX-INTRANET\username. ---> System.Data.SqlClient.SqlException: Login failed for user XXX-INTRANET\username.
That error message means "Invalid UserID". If you're running IIS, make sure your application pool uses the same identity as the user who you are connecting to the database with in management studio.
If you're not running under IIS, make sure your current user account (Windows) can access the database, as you're using Integrated Security.
Link on the error: http://blogs.msdn.com/b/sql_protocols/archive/2006/02/21/536201.aspx
EDIT: Hang on, you're missing Initial Catalog. Try this:
"Data Source=SERVER1\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=YourDatabase"
I faced a similar problem and I realized that unlike Entity Framework, (Fluent)NHibernate does not create a database for you. The solution was to create an empty database.
The following segment in your ConnectionString means that database xxx must already exist:
Initial Catalog=xxx
I cleaned the whole solution now it works. Sorry to waste your time, guys. Appreciate your answers.
I couldn't get it to work with Integrated Security, I had to supply a user and password in the connection string.
I'm trying to move my APN backoffice from PHP to C# for performance issue. Bear with me, I'm new to C# and mono.
I've just downloaded MonoDevelop 2.8.6.4 and APNS-sharp merge 26 on my OSX 10.7.2
I opened the entire solution with all libraries and test executables and built the entire solution without errors. I modified the fields (token id, cert file, ...) in the Program.cs in JdSoft.Apple.Apns.Notifications.Test to meet my specs.
After a few tries I managed to get my certificate file OK and the connection to Apple servers is now up. I see the message saying I'm connected in the output of the application.
Probleme comes now. Everytime the application tries to send a message to Apple I get the error "A Type load exception has occured". I tried a little debug and the error seems to come from the NotificationPayload constructor.
Doing step by step follow up, it appears the NotificationAlert is correctly instantiated inside the NotificationPayload constructor. The error appears when coming back to the Notification constructor where the Payload member appears in the debugger as "A type load exception has occurred." instead of an object.
From there the Notification object ends up with the same behavior.
From my research on the Internet this could come from the version of Newtonsoft.Json.Compact.dll but I have no idea what to do with this piece of information.
For information I can see the same error when running the compiled test on my CentOS server.
And for more information the application message (changed ex.Message to ex.ToString() in the test program to get a full error) :
Notification Queued!
Sleeping 15000 milliseconds before next Notification...
Connecting...
Connected...
Error: System.TypeLoadException: A type load exception has occurred.
at JdSoft.Apple.Apns.Notifications.Notification.ToBytes () [0x0006c] in /Users/laurent/Downloads/Redth-APNS-Sharp-595275f 2/JdSoft.Apple.Apns.Notifications/Notification.cs:90
at JdSoft.Apple.Apns.Notifications.NotificationChannel.Send (JdSoft.Apple.Apns.Notifications.Notification notification) [0x00000] in /Users/laurent/Downloads/Redth-APNS-Sharp-595275f 2/JdSoft.Apple.Apns.Notifications/NotificationChannel.cs:371
at JdSoft.Apple.Apns.Notifications.NotificationConnection.workerMethod () [0x00035] in /Users/laurent/Downloads/Redth-APNS-Sharp-595275f 2/JdSoft.Apple.Apns.Notifications/NotificationConnection.cs:381
I didn't put the code, as I didn't change anything from the one you can see at https://github.com/Redth/APNS-Sharp.
I send an SOS to all mono guru around.
Have a nice day fellow developers and thanks in advance for your help and time. Any suggestion is gladly welcome.
(As the OP can't post the answer himself...)
In this particular case, the solution was to fetch the latest version of Newtonsoft.Json.Compact.dll.
In general, you need to try to get as much information from the exception as possible, to find out what it was trying to load - then check that the problematic library is present, and that you've got the version everything else expects.
I'm using Visual Studio 2008 and SqlExpress to develop a windows application.
I have created a database and trying to create a Crystal report using it. But when I use the Wizard to create the Report( as I use OLE DB Provider for Sql Server) I get the following Error message:
Title of the error message:
Crystal Reports ActiveX Designer
Body of the error message says:
Not Implemented
Details:Error Code:0x
Source: ADODB.Connection
Description:Object or Provider is not capable of performing requested operation.
Can anyone help me out of this problem. I'm a very new person in this field, so it will be helpfull if you help me in details..
Thanks in Advance.
This thread on MSDN indicates that for some this problem was caused by an unusual database name with special characters. Does yours contain something like . or # ?