Post by westingtyler on Dec 6, 2022 4:01:22 GMT
In a c sharp function I basically want to give the string for a character name and a word the player typed, and find (if it exists, if not null) the cell in the database, and save it to a string.
The manual and examples don't have a simple query like this, but instead have examples of gathering lots of things at once (Weapons), so I've tried to put it together but can't figure out what is wrong. I got this working in playmaker back in the day but can't figure it out in C sharp.
=======
public void QueryTheRequestedResponse()
{
bool recordExists;
CurrentResponseSTR = dbManagerU6.Query("SELECT Response FROM UltimaVIDialogue WHERE CharaName = '" + CurrentConversantNameSTR + "' AND Keyword = '" + CurrentQuerySTR + "'");
if (recordExists)
Debug.Log("record found." + CurrentResponseSTR);
else
//print the text "No record found." to the screen.
Debug.Log("No record found.");
}
----
but it gives the error: Assets\ConversationProcessor.cs(98,42): error CS0411: The type arguments for method 'SimpleSQLManager.Query<T>(string, params object[])' cannot be inferred from the usage. Try specifying the type arguments explicitly.
I don't really know coding and am coming from using Playmaker, so I cannot figure it out.
I wish the manual had just a thousand slightly different examples because someone like me, I can't figure out how to take a query for a list of objects, and convert it to a query for a single object, etc.
It seems like it wants me to make a class to put in the <> part, but I never had to make a custom class to use SimpleSQL with playmaker. I could just say, "query this database and save the results as a string. how can I do that?
The manual and examples don't have a simple query like this, but instead have examples of gathering lots of things at once (Weapons), so I've tried to put it together but can't figure out what is wrong. I got this working in playmaker back in the day but can't figure it out in C sharp.
=======
public void QueryTheRequestedResponse()
{
bool recordExists;
CurrentResponseSTR = dbManagerU6.Query("SELECT Response FROM UltimaVIDialogue WHERE CharaName = '" + CurrentConversantNameSTR + "' AND Keyword = '" + CurrentQuerySTR + "'");
if (recordExists)
Debug.Log("record found." + CurrentResponseSTR);
else
//print the text "No record found." to the screen.
Debug.Log("No record found.");
}
----
but it gives the error: Assets\ConversationProcessor.cs(98,42): error CS0411: The type arguments for method 'SimpleSQLManager.Query<T>(string, params object[])' cannot be inferred from the usage. Try specifying the type arguments explicitly.
I don't really know coding and am coming from using Playmaker, so I cannot figure it out.
I wish the manual had just a thousand slightly different examples because someone like me, I can't figure out how to take a query for a list of objects, and convert it to a query for a single object, etc.
It seems like it wants me to make a class to put in the <> part, but I never had to make a custom class to use SimpleSQL with playmaker. I could just say, "query this database and save the results as a string. how can I do that?