|
Bonjour,
J'ai téléchargé le dossier .zip ODAC112040Xcopy_32bit et ODAC112040Xcopy_64bit
Est ce que je dois utiliser ODAC 32bit ou bien ODAC 64bit ?
Ce dossier contient plusieurs types de dll
alors quel(s) .dll à ajouter dans mon projet ?
|
|
|
|
|
Translated:
Quote: Hello
I downloaded the .zip folder ODAC112040Xcopy_32bit and ODAC112040Xcopy_64bit
Do I have to use ODAC 32bit or ODAC 64bit?
This folder contains several types of dll
so what .dll to add to my project?
You're doing this all wrong. You don't just add a .DLL to your project. Oracle does not work that way. Forget what you downloaded.
You have to install the Oracle Client and add ODP.NET to your project through the Nuget Package Manager under the Tools menu in Visual Studio. In NPM, search for "ODP.NET4" and add that to your project.
When deploying your application to a server, that server must also have the Oracle Client installed else your application will not work.
|
|
|
|
|
Actually, the XCopy installation of Oracle client should work if you add all the files to the bin folder.
But only if you don't have another installation with another bitness.
|
|
|
|
|
Bonjour,
J'ai téléchargé "ODAC112040Xcopy_32bit" et j'ai copié les .dll necessaires dans mon projet et j'ai ajouté le driver "Oracle.DataAccess.dll" dans la partie reference de mon projet. J'ai target platform avec 32 bit.
Après compilation et exécution, alors le driver a été bien chargé mais je ne peux pas connecter au base oracle sachant que de version 9i et lire le contenu d'une table.
J'ai le message suivant :
System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'Oracle.DataAccess.Client.OracleConnection'. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
à Oracle.DataAccess.Client.OracleInit.Initialize()
à Oracle.DataAccess.Client.OracleConnection..cctor()
--- Fin de la trace de la pile d'exception interne ---
à Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
à WebServiceToBD.Service1.view_data() dans d:\Developpement\SiteVs2012\WebServiceToBD\Service1.asmx.cs:ligne 48
Voici le code de méthode :
public DataTable view_data()
{
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
conn.Open();
OracleDataAdapter dr = new OracleDataAdapter("select * from Personne", conn);
DataSet ds = new DataSet();
ds.Tables.Add("Personne");
dr.Fill(ds,"Personne");
DataTable tt = ds.Tables[0];
return tt;
}
<pre lang="c#">
La ligne 48 correspond au code suivant :
<pre lang="c#">OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
Cette chaîne de connexion existe dans le programme et pas dans le fichier "Web.config".
modified 12-Jun-20 3:54am.
|
|
|
|
|
When you are using unmanaged code (the Oracle Client in this case), EVERYTHING need to have the same bitness (32 or 64 bits), including the client, debugger, IIS Application pool and the VSHost.exe.
More info on that here: Visual Studio Debugging and 64 Bit .NET Applications - Rick Strahl's Web Log[^]
In this case I'm not even sure if you have the same bitness on the Oracle.DataAccess.dll and the rest of the client files.
You can use corflags.exe to determine bitness of an .exe
|
|
|
|
|
Thanks it works for the driver.
I used this driver in a .net web service. Then I will call this web service in another asp net project. The web service call and the data recovery work on a table with a reduced number of lines.
Now, I wanted to retrieve the contents of a table that contains 1844 rows and 58 columns.
After compilation and execution, I have the following message:
Server error in application '/'.
The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information on the error and its origin in the code.
Exception details: System.ServiceModel.QuotaExceededException: The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
modified 12-Jun-20 9:17am.
|
|
|
|
|
|
Erreur du serveur dans l'application '/'.
Le quota de taille maximale autorisée pour les messages entrants (65536) a été dépassé. Pour augmenter le quota, utilisez la propriété MaxReceivedMessageSize sur l'élément de la liaison appropriée.
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: System.ServiceModel.QuotaExceededException: Le quota de taille maximale autorisée pour les messages entrants (65536) a été dépassé. Pour augmenter le quota, utilisez la propriété MaxReceivedMessageSize sur l'élément de la liaison appropriée.
|
|
|
|
|
Random random = new Random();
int character = 15;
int mobhp = 3;
Console.WriteLine("You are an adventuurer.");
Console.WriteLine("you are walking across the forest when suddenly you encounter a");
string [] monster = {"imp", "goblin", "hobgoblin",};
string monsters = (monster[(random.Next(0, 3))]);
Console.WriteLine(monsters);
switch (monsters){
case "goblin":
mobhp = 11;
break;
case "imp":
mobhp = 8;
break;
case "hobgoblin":
mobhp = 15;
break;
}
string entry = Console.ReadLine();
string hit = "attack";
string regenerate = "heal";
string escape = "run";
switch (entry){
case "hit":
mobhp = mobhp - 4;
Console.WriteLine("You attacked it!");
break;
case "regenerate":
character = character + 2;
Console.WriteLine("you heald 2 hp");
break;
case "escape":
Console.WriteLine("you cant run away!");
break;
|
|
|
|
|
Have you tried putting your questions and answers in a loop that terminates when mobhp is <= 0?
|
|
|
|
|
Hi every body
I've question about thread.
My project get data from IO (use control InstantDiCtrl of Advanetect)
Code: InstantDiCtrl.ReadPort(0, ref data)
When I code on timer function data can get.
but when I code on thread can not get data (always output 0)
What diffrent about thread and timers.
Thank you
|
|
|
|
|
You can't compare threads and timers: that's like comparing electricity to an orange.
A thread is a separately executing "chunk" of code with its own stack which operates independently within a process but which shares common memory with other threads in the process.
A timer is a (fairly) regular event which happens within a thread at an interval.
You need to look at your code - both thread and timer - to work out why your threaded version doesn't work. We can't do that as we have no access to your code other than exactly what you show us - and your code fragment is useless out of context. Do remember that threads cannot access any Controls directly: trying will get you a cross threading exception. Timers don;t have this problem as they run within the thread that created the Timer object.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You can't access/use controls/variables from different threads. Your normal application is the main-thread, and within it, you can access all that you create there. The timer interrupts execution of that mainthread to execute the timed code with that thread.
If you create a new thread, then this will run seperately from the mainthread, without interrupting it. That's the preferred way, but you'd need to read up on how to synchronize your data with the mainthread.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hello, I'm currently making a program that will take a HEX string and convert it into an image.
I talked to a experienced coder and he gave me some steps to my problem:
1) Create a simple hello world program with a main method
2) Make it so your program can print out the byte array you input to the console
3) Figure out how to link in the libraries the code you posted references (looks like SkiaSharp and PakReader)
4) Make the call to the code you showed (TextureDecoder.DecodeImage)
5) Write the resulting SKImage to a file
I'm trying to call a method from a separate program. I'm really inexperienced and confused even after looking at documentation and multiple YT videos.
I had a couple of questions about how I should do this:
I'm trying to call
TextureDecoder.DecodeImage
from the program in the link below.
hastebin[^]
MY current code so far, based off of the first 3 Steps a guy gave me for help:
using System;
using System.IO;
using PakReader.Parsers.Objects;
using SkiaSharp;
namespace EncyptedViewing
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("HEX Input");
}
}
}
I would like to know how I would call the class from the link above TextureDecoder.DecodeImage into the program above, or is that not possible and I need to do it all in one program?
Thanks, and stay safe.
|
|
|
|
|
Try
SKImage ski = PakReader.TextureDecoder.DecodeImage(sequence, width, height, depth, format); You'll have to work out what the parameter values contain for yourself: we have no idea what you are trying to do with it.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I entered code from a YouTube video into Microsofts version 8 compiler but can't get the cards to display. The code is written in 2017 for an older compiler.
In the code it has
Public override string ToString()
{
Return face + " of " + suit;
}
Would this code apply to the latest microsoft compiler?
The only code for printing the cards is
Console.write( deck1.DealCard());
Which is looped.
The problem is finding out why the cards are not displayed.
If needed I could give you the whole code but I can't remember how you format the code in this forum.
Cards should be printed as 4 of hearts etc.
Brian
|
|
|
|
|
The code applies to any version of C#. There's really nothing to it. All it's doing is returning a string with the value of face and suit converted to strings.
Those two variables have to be supplied by other code in your class.
There's no way to tell you what you're doing wrong since we can't see the code for the type deck1 is, nor can we see the code for what, I assume, your card class is.
You're going to have to hit the "Improve question" button to add the relevant code to your question.
Also, stay away from YouTube videos for learning to code. I haven't seen a good one yet.
|
|
|
|
|
Dave Kreskowiak wrote: stay away from YouTube videos for learning to code. I haven't seen a good one yet.
I suspect that most of 'em are created by people who
1) Have no idea how to make a good video
And
2) Have no idea how to code.
They have code that works, but they have no idea why it does - so they blindly type it in and then show "working" results - that most times are unrelated to the code they actually typed.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yeah.
Every video I've seen doesn't go into anywhere enough detail as to why they are doing the things they are. I suspect this is because of just what you said. They have no idea what they're doing.
Just showing what may even be simplified code from a more complex topic is done without sufficient explanation.
|
|
|
|
|
Hi Griff.
Can you suggest somewhere that I might be able to find C# code listing for a card shuffing program or any card program.
Brian
|
|
|
|
|
<pre lang="c#">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Card_Shuffle
{
public class Deck
{
private Card[] deck;
private int currentCard;
private const int NUMBER_OF_CARDS = 52;
private Random ranNum;
public Deck()
{
string[] faces = { "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nin", "Ten", "Jack", "Queen", "King" };
string[] suits = { "Hearts", "Clubs", "Diamonds", "Spades" };
deck = new Card[NUMBER_OF_CARDS];
currentCard = 0;
ranNum = new Random();
for (int count = 0; count < deck.Length; count++)
deck[count] = new Card(faces[count % 11],
suits[count / 13]);
}
public void Shuffle()
{
currentCard = 0;
for (int first = 0; first < deck.Length; first++)
{
int second = ranNum.Next(NUMBER_OF_CARDS);
Card temp = deck[first];
deck[first] = deck[second];
deck[second] = temp;
}
}
public Card DealCard()
{
if (currentCard < deck.Length)
return deck[currentCard++];
else return null;
}
public class Card
{
private string face;
private string suit;
public Card(string cardFace, string cardSuit)
{
face = cardFace;
suit = cardSuit;
}
public override string ToString()
{
return face + " of " + suit;
}
}
static void Main(string[] args)
{
Deck deck1 = new Deck();
deck1.Shuffle();
for (int i = 0; i < 52; i++)
{
Console.Write("0-19)", deck1.DealCard());
if ((i + 1) % 4 == 0)
Console.WriteLine();
}
Console.ReadLine();
}
}
}
</pre>
At the moment I get 13 rows of the below text displayed.
0-19)0-19)0-19)0-19)
Brian
|
|
|
|
|
Brian_TheLion wrote: At the moment I get 13 rows of the below text displayed. Quite right because that is what your code is doing. Look at the line:
Console.Write("0-19)", deck1.DealCard());
It says print the string "0-19)"; the second part deck1.DealCard() returns a string but does nothing with it. The rest of the code does very little of any use.
As already suggested you should stop wasting your time on YouTube and get hold of a decent book on C#.
|
|
|
|
|
Hi Richard.
Do you think there is some code missing?
If this is the case then I may have to give up on getting this code to work unless you could suggest some extra code I could add to the existing code.
Brian
|
|
|
|
|
Quite frankly I don't think it's the best design of a card class that I have seen. Also, nearly all the code we see here that is taken code from a Youtube video, turns out to be not very well written. Youtubers tend not to be particularly skilled coders. If you want to learn C# properly then get hold of a decent book on the subject, it will be time and money far better spent.
|
|
|
|
|
Brian_TheLion wrote:
Console.Write("0-19)", deck1.DealCard()); I suspect that should be:
Console.Write("{0,-19}", deck1.DealCard()); Composite formatting | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|