当我尝试运行程序时,我正在尝试将程序连接到Oracle数据库,出现以下错误:(DillNotFoundException:gda-2 System.Data.OleDbConnection.Open()) 导致错误的行位于 con.Open() 我看过一些有关此错误的论坛,但仍然找不到该问题的解决方案。 有谁可以帮助我吗? 这是代码:
System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Data;
using UnityEngine.UI;
using System.Text.RegularExpressions;
using System;
using System.Data.Odbc;
using System.Data.SqlClient;
using System.Data.Sql;
using Oracle.DataAccess.Client;
//using System.Data.OracleClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//using Tutorial.SqlConn;
using Oracle.DataAccess.Types;
//using Oracle.ManagedDataAccess;
using System.Data.OleDb;
//using System.Data.UpdateRowSource;
public partial class CreateAccount : MonoBehaviour
{
// creation of GameObject
public GameObject username;
public GameObject password;
public GameObject confPassword;
//
private string Username;
private string Password;
private string ConfPassword;
void Start()
{
//RegisterButton();
}
public void RegisterButton()
{
/*bool UN = false;
bool PW = false;
bool CPW = false;*/
if (Username != "" && Password != "")
{
OleDbConnection con = new OleDbConnection(@"Provider = MSDAORA;Data Source=orcl;Persist Security Info=True;User ID=hr;Password=hr;Unicode=True");
con.Open();
string cmdText = @"INSERT INTO PLAYER VALUES('" + username.GetComponent<InputField>().text + "','" + password.GetComponent<InputField>().text + "')";
OleDbCommand cmd = new OleDbCommand(cmdText, con);
cmd.ExecuteNonQuery();
con.Close();
}
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Tab))
{
if (username.GetComponent<InputField>().isFocused)
{
password.GetComponent<InputField>().Select();
}
/*if (password.GetComponent<InputField>().isFocused)
{
confPassword.GetComponent<InputField>().Select();
}*/
}
if (Input.GetKeyDown(KeyCode.Return))
{
if (Password != "" && Username != "")
{
RegisterButton();
}
Username = username.GetComponent<InputField>().text;
Password = password.GetComponent<InputField>().text;
//ConfPassword = confPassword.GetComponent<InputField>().text;
}
}
}
答案 0 :(得分:0)
您应该将丢失的.dll文件放在此位置:
>>> pipenv install <module_name>