|
Dear friends,
I have a window scheduler which pionts an exe.
This schduler failes while starting automatically where as if i run maunally, it is executed successfully.
Front End: DotNet 2.0
Back end: Oracle 9i
The error message which i get is
OCIEnvCreate failed with return code -1
I'm cluless.
Thanks & regards
SWARAN
|
|
|
|
|
Swaranjeet Singh wrote: OCIEnvCreate failed with return code -1 I'm cluless.
The first thing to do is to find the documentation for this function and see if you can determine what a status of -1 indicates. If it follows the usual patterns then there should be some more data somewhere that will give you a more specific reason.
I must get a clever new signature for 2011.
|
|
|
|
|
thanks for your response.
The error which i got is
OCIEnvCreate failed with return code -1 but error message text was not available.
This error captured at the time of establishing connection to the database.
|
|
|
|
|
Did you ask Google?
Here[^] is the first hit, I suggest you read it.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Assuming both are running on the same machine, it sounds like a possible permissions issue. Does the account the Scheduler task is using have permissions set in the Oracle client config?
"You get that on the big jobs."
|
|
|
|
|
It's probably a permissions issue as your windows service will be running under its own identity as opposed to your user identity. To resolve this, take a look at these threads 1[^] and 2[^].
|
|
|
|
|
I'm also facing the same issue.I tried the ways you suggested.
I'm not getting this error regularly.its fluctuating.
|
|
|
|
|
How to create master form in .net winform 1.1 same as in asp.net master page
Thanks in advance
|
|
|
|
|
WinForms works in a different way than ASP.NET, there is no masterpage-concept. You can create a new form, and inherit from it. Would look something like this;
public MyMasterForm: Form
{
}
public MyNewForm: MyMasterForm
{
} Good luck
I are Troll
|
|
|
|
|
You can do as Eddy suggested, or otherwise you could create one form with a panel that gets populated with Usercontrols.
|
|
|
|
|
Hola,
So here's the thing..
I'm using Visual Web Developer 2010 Express and SQL Server 2008, and I'm trying to connect to this goddamn database using C#.
I've created an ASP.NET Empty Website, and I've created an SQL Server Database in the project as well.
So here's how my Page_Load function looks (where I try to connect to the database):
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlCon = new SqlConnection("server=localhost;database=Database;Trusted_Connection=yes;connection timeout=8");
try
{
sqlCon.Open();
}
catch (Exception err)
{
errorLbl.Text = err.ToString();
}
}
But it just won't work...
I'm obviously doing something wrong here, but what?
And what's this bullshit about username and password in the connection string? It's just a local database for god's f***ing sake!!!!
Thanks in advance,
Jop
modified on Tuesday, March 22, 2011 6:32 AM
|
|
|
|
|
You missed the vital piece of information out of your rant here - what's the exception? Throw us a bone here.
JoplinsSlave wrote: And what's this bullsh*t about username and password in the connection string?
It's just a local database for god's f***ing sake!!!!
It's a local database that can be evaluated by outside systems, so I'd assume that security might be reasonably important to you.
At a guess, I'd suspect that the issue you are facing relates to the fact that the user identity you think is hitting the database is not the one that is actually hitting the database. When you develop a website and host it in your webserver, by default it runs under a user account with lowered privileges (for security reasons). This means that even though you are connecting from your client code when you log in as you, the actual account that's hitting the database is the account that the web site is running under.
|
|
|
|
|
Thanks a lot for taking your time to answer me, despite the ridicilous tone I had..
It's in swedish so it's most likely rather jibberish to you, but it basically says "The server could not be found or is not available".
I run it on IIS however, which is why username and password confuse me.
Also, should I really use localhost as server when I'm running it local like this?
Thanks,
Jop
|
|
|
|
|
I believe you may have to change localhost to (local) , and you need to add the SQL Server instance name in if it's running as SQL Express (or as a named database instance). Suppose the instance was called Jop, then the server name would look like (local)\Jop .
|
|
|
|
|
Thanks a lot. I finally solved it. I shouldn't use (local) but I searched around a little about the instance name and sh*t and it turned out there was a generated connections string I could use with some modification.
Jop
|
|
|
|
|
Good job.
|
|
|
|
|
Try using Trusted_Connection=True in your connection string.
Connection Strings[^] is a useful resource.
|
|
|
|
|
Thanks, I tried it but it made no difference, I figure yes and True works the same in this case.
|
|
|
|
|
Trusted_Connection=yes means SSPI=true, which uses windows authentication. It has happened to me that 'localhost' is not accepted as server name and you need to specify complete name of machine; eg: DTPXP_ABC_COMPUTER.
Please try same and check.
Also, do post error message as it makes us more good to help you.
modified and added: try checking un-checking anonymous login in IIS, as that could be reason you couldn't get through...
|
|
|
|
|
It says "The server could not be found or is not available".
Also, I did try to replace localhost with my computer's name, but it made no difference unfortunately.
What I've concluded after some reading is that I shouldn't be needing username and psw when I set Trusted_Connection to true.
Thanks,
Jop
|
|
|
|
|
No specific answers I'm afraid, but a few things which spring to mind.
Firstly http://www.connectionstrings.com is the thing I always use because I can't remember connection strings. I've checked that and what you have looks OK. I don't believe there's any case-sensitivity in them, but as one poster pointed out, get rid of the 'yes' and replace with 'true'.
In terms of username and password, SQL Server can run in two modes - SQL Server Authentication which has a username and password or Windows Authentication which uses your domain identity. The latter is preferred as you don't have to expose authentication details in config etc.
The only thing I can suggest is check that you have the relevant protocols switched on, particularly named pipes as this is what I believe local connections use by preference. Go to the SQL Server Configuration tool->SQL Server Network Configuration->Protocols and set them all on. I've been stung by that before...
Regards,
Rob Philpott.
|
|
|
|
|
Oh, its solved. Duh, well forget all that then.
Regards,
Rob Philpott.
|
|
|
|
|
|
I'm having trouble with getting data from a ms access database and displaying the data in a datagridview and importing some data back to the database.
It's so simple to most data types, but the data I mentioned above are kind of rich text not plain text, and I have already saved them as WORD OLE Objects in my database, I can view and edit them easily with MS Access database management system, but how to do those with my application?
Another problem of mine is how to show combo box columns in the datagridview when loading them from the database (I mean my database has some table with some combo box columns), I tried loading them to my datagridview (using AutoGenerateColumns = true) but the combo box columns in my database turned into text columns in my datagridview? I have already known a way to solve that by hiding the text columns and inserting new combo box columns into the datagridview (at right positions) instead or setting AutoGenerateColumns to false and adding new columns to the datagridview each one by one before filling its contents with a datatable.
Both those ways are not simple well, I wonder if we have another way easier?
The same ease you can find is when you load checkbox columns into your datagridview, it automatically displays them as checkbox columns without doing anything more, I wish we could do that way with combo box columns!
Could you please help me solve these!
Thank you so much!
Best Regards.
|
|
|
|
|
Hey there, everyone. I'm a long time member, but my responsibilities don't get me into code too often...so, please go easy on me
I'm using .Net 4.0, WCF and my goal is to call a webservice - one that is not known at compile time. Now I know that during development, I can right click > Add Service Reference, but that's not what I'm looking for..again the web service won't be known at compile time.
So, I've made it as far as to dynamically call a webservice and import all its contracts via the code below (taken from MSDN). And from that I can see all the different web service methods that are available in my webservice (in the string sWSDL at the very top).
My question, then: How can I call this web service? I understand the definition, but I don't understand how to invoke it. Any help would be much appreciated.
MetadataExchangeClient mexClient = new MetadataExchangeClient(new Uri(sWSDL), MetadataExchangeClientMode.HttpGet);
mexClient.ResolveMetadataReferences = true;
MetadataSet metaDocs = mexClient.GetMetadata();
WsdlImporter importer = new WsdlImporter(metaDocs);
ServiceContractGenerator generator = new ServiceContractGenerator();
object dataContractImporter;
XsdDataContractImporter xsdDCImporter;
if (!importer.State.TryGetValue(typeof(XsdDataContractImporter), out dataContractImporter))
{
Console.WriteLine("Couldn't find the XsdDataContractImporter! Adding custom importer.");
xsdDCImporter = new XsdDataContractImporter();
xsdDCImporter.Options = new ImportOptions();
importer.State.Add(typeof(XsdDataContractImporter), xsdDCImporter);
}
else
{
xsdDCImporter = (XsdDataContractImporter)dataContractImporter;
if (xsdDCImporter.Options == null)
{
Console.WriteLine("There were no ImportOptions on the importer.");
xsdDCImporter.Options = new ImportOptions();
}
}
System.Collections.Generic.IEnumerable<IWsdlImportExtension> exts = importer.WsdlImportExtensions;
System.Collections.Generic.List<IWsdlImportExtension> newExts
= new System.Collections.Generic.List<IWsdlImportExtension>();
foreach (IWsdlImportExtension ext in exts)
{
Console.WriteLine("Default WSDL import extensions: {0}", ext.GetType().Name);
newExts.Add(ext);
}
System.Collections.Generic.IEnumerable<IPolicyImportExtension> polExts = importer.PolicyImportExtensions;
importer = new WsdlImporter(metaDocs, polExts, newExts);
System.Collections.ObjectModel.Collection<ContractDescription> contracts
= importer.ImportAllContracts();
importer.ImportAllEndpoints();
</pre>
<div class="signature">Marcus Spitzmiller</div>
|
|
|
|