当我试图运行该程序时,我试图将我的程序连接到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;
}
}
}发布于 2018-10-12 14:32:24
您应该将丢失的.dll文件放在这个位置:
[UNITY_INSTALL_DIR]\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\DLL_HEREhttps://stackoverflow.com/questions/52781601
复制相似问题