Answer the question
In order to leave comments, you need to log in
Does Unity have something similar to ExecuteScalar?
Hello, please tell me if there is something similar to ExecuteScalar? I'm trying to make an entrance. I
wrote such a code, but apparently they don't prescribe it in the unit, please tell me how it will be more correct?
public void GetDB()
{
conn();
try
{
string log= Inputlog.text.ToString();
string _pass = Inputpass.text.ToString();
cmd_db = new SqliteCommand("Select Password from User Where login='" + log+ "'");
if (cmd_db.ExecuteScalar() != null)
{
if (cmd_db.ExecuteScalar().ToString() == _pass)
{
cmd_db2 = new SqliteCommand("Select id from User Where log='" + log+ "'");
int id = Convert.ToInt32(cmd_db2.ExecuteScalar());
}
else
{
print("Неверный пароль!");
}
}
else
{
print("Неверный логин!");
}
}
catch (Exception ex)
{
print(ex.ToString());
}
Answer the question
In order to leave comments, you need to log in
I'm not sure that work with SQL is generally included in the dotnet unit implementation. Therefore, either look for a compatible library, or work through some api with the base and not directly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question