Why i can't initialize quartz.net adoJobStore with oracle? - c#

I'm trying to setup quartz.net AdoJobStore with oracle.
I have a valid schema with tables for quartz.
But every time i'm facing the same Exception "Could not Initialize DataSource: default" at the last line of this code.
NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "TestScheduler";
properties["quartz.scheduler.instanceId"] = "instance_one";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
properties["quartz.dataSource.default.connectionString"] = "Data Source=//192.168.0.221:1521/ESPDB;User Id=quartz;Password=quartz";
properties["quartz.dataSource.default.provider"] = "OracleODP-20";
//
ISchedulerFactory schedulerFactory = new StdSchedulerFactory(properties);
IScheduler scheduler = await schedulerFactory.GetScheduler();
Same exception i was faced when i'm trying to use config file.
I'm using version 3.0 of quartz.

Try to modify last property as follows
properties["quartz.dataSource.default.provider"] = "OracleODP";
It worked for me.
I think OracleODP-20 could be the old value of Oracle data provider for previous version of Quartz.net as you can read here.

Related

Exception when attempting to authenticate to AD using System.DirectoryServices.Protocols

Want to share with the community a recent exception I encountered after our network folks enabled channel binding on our AD. The change was inspired by KB4520412
My initial code logic was as follows and worked flawlessly up until the recent change.
var cred = new NetworkCredential(credentials.UserId, credentials.Password);
var serverId = new LdapDirectoryIdentifier(host, port);
using var conn = new LdapConnection(serverId, cred);
conn.Bind();
After the change my code started receiving exceptions
"The supplied credential is invalid"
Inner Exception
"80090346: LdapErr: DSID-0C09059A, comment: AcceptSecurityContext error, data 80090346, v3839"
To remedy the exception I changed my code to the below.
using var conn = new LdapConnection(serverId, cred,AuthType.Basic);
conn.SessionOptions.ProtocolVersion = 3;
conn.SessionOptions.SecureSocketLayer = true;
conn.SessionOptions.FastConcurrentBind();
conn.Bind();
Remedied the exception by implementing a change to the session options as follows.
using var conn = new LdapConnection(serverId, cred,AuthType.Basic);
conn.SessionOptions.ProtocolVersion = 3;
conn.SessionOptions.SecureSocketLayer = true;
conn.SessionOptions.FastConcurrentBind();
conn.Bind();

VssConnection SP324098: Your browser could not complete the operation

I am using the following code to try and connect to Azure DevOps and to retrieve a list of work item types, however I keep getting this exception:
BrowserFlowException: SP324098: Your browser could not complete the
operation
There doesn't seem to be much information around this exception. Does anyone know what's going on here? I am using Visual Studio 2017, Enterprise Edition updated to latest build on a Windows 10 updated to latest build machine.
VssClientCredentials credentials = new VssClientCredentials();
VssClientHttpRequestSettings settings = new VssClientHttpRequestSettings
{
AllowAutoRedirect = true
};
VssHttpMessageHandler vssHandler = new VssHttpMessageHandler(credentials, settings);
using (VssConnection connection = new VssConnection(this.CollectionUri, credentials, settings))
{
connection.ConnectAsync().SyncResult();
// Create instance of WorkItemTrackingHttpClient using VssConnection
WorkItemTrackingHttpClient witClient = connection.GetClient<WorkItemTrackingHttpClient>();
var workItemTypes = witClient.GetWorkItemTypesAsync(ProjectName).SyncResult(); ; //exception happens here, I see the login box here too
}

SMO syntax in C#

I am trying to use Microsoft.SqlServer.Management.Smo to extract server values in C#. I'm having difficulty with the syntax.
Server server = new Server(new ServerConnection { ConnectionString = new SqlConnectionStringBuilder { DataSource = #"localhost", IntegratedSecurity = true }.ToString() });
Dts.Variables["User::test"].Value = server.AuditLevel____??_____;
Trying to use the Server.AuditLevel:
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.auditlevel.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1
Could someone provide an exable using both "get" and "set"?
Following code worked
Dts.Variables["User::test"].Value = Convert.ToInt32(server.AuditLevel);
The Microsoft.SqlServer.Management.SqlEnum reference needs to be added as well.

How can I set connection string of a stimulsoft report at run time on web service

I created a report in stimulsoft in asp.net c#. I created a new connection and then new data source, and added an exiting stored procedure to it. then I assigned columns and parameters this data source to my report.my problem is that :
when i create new sqlconnection manually the connection string is :
Data Source=my_pc-PC\my_servername;Integrated Security=True;Initial Catalog=my database_name
when i run my site in my pc every thing is good an work. but when i set my site on web service do i do any thing to show my report successfully.
my code for run report:
Stimulsoft.Report.Components.StiText t = new Stimulsoft.Report.Components.StiText();
t.Text = DateLabel.Text;
string str4 = Decrypt(Request.QueryString["select_rep_"]);
if (str4 == "1")
{
string str1 = Decrypt(Request.QueryString["fromdate_"]);
string str2 = Decrypt(Request.QueryString["todate_"]);
string ConnectionString = ConfigurationManager.ConnectionStrings["my_ejraConnectionString"].ConnectionString;
string serverlocation = HttpContext.Current.Server.MapPath(string.Empty);
StiReport myreport = new StiReport();
myreport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Coneection", ConnectionString));
t.Text = DateLabel.Text;
myreport.Load(serverlocation + "\\rep\\myreport.mrt");
myreport.Dictionary.Variables["fromdate"].Value = str1;
myreport.Dictionary.Variables["todate"].Value = str2;
myreport.Dictionary.Variables["today"].Value = t.Text;
StiWebViewer1.Report = myreport;
}`enter code here`
is this code work without any change on web server?
Do this, clear databases before use it :
myreport.Dictionary.Databases.Clear();
myreport.Dictionary.Databases.Add(new StiSqlDatabase("ConnectionName", "ConnectionString"));
This is Working to me, in Asp.Net Core 2.0
follow this code:
var myreport = new Stimulsoft.Report.StiReport();
_myreport.Load(#"C:\Users\Admin\Desktop\report.mrt"); // load report file
((StiSqlDatabase)myreport.Dictionary.Databases["Connection"]).ConnectionString = "new ConnectionString"; // set new connection string
myreport.Render();
need to install NuGet Package Stimulsoft.Reports.Web.NetCore version 2018.3.5
Hope to be useful.

Error: Invalid object "tbl_name"

I am creating a small project by using winforms in C# using Visual Studio 2010 and SQL Server 2008 - When I am creating setup and running it on the same computer it is working very well - but when I am running it on a different computer I got an error (Invalid object "tbl_name")! I'm using (SQL Server authentication) and my connection code is:
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = ".";
builder.InitialCatalog = "Sectors";
builder.IntegratedSecurity = false;
builder.Password = "123";
builder.UserID = "MAK";
builder.AsynchronousProcessing = true;
builder["Trusted_Connection"] = true;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = builder.ConnectionString;
conn.Open();
Please help me find the cause of the error and resolve it.
You could remove the statement "builder["Trusted_Connection"] = true;" and also try to change the connection settings (like DataSource to localhost).

Categories

Resources