|
Post by jayantha on Dec 11, 2022 2:21:04 GMT
My insert /update functions works properly.(one table with 2 fields)
I tried to display warning in the screen if the user insert existing data .
public void existdata()
{
var indexnum = indexInput.text;
var stduname = stuname.text;
bool recordExists;
var firstRecord = dbManager.QueryFirstRecord<mytable>(out recordExists, "SELECT * FROM mytable WHERE stuid = ?", indexnum);
if (recordExists)
{
lblText.text = "PlayerId: " + indexnum;
btnUpdate.enabled = false;
btnInsert.enabled = false;
}
else
{
btnUpdate.enabled = true;
btnInsert.enabled = true;
lblText.text = "";
}
}
I attached this to insert button but it does not display the warning. I attach this to input field text box(which contains field with primary key).Then it display part of the value (lblText.text = "PlayerId: " + indexnum;)and warning and disappear..I like if I can add this to insert button.Please help me or let me know the best way.Thank you
|
|
|
Post by echo17 on Dec 11, 2022 14:41:49 GMT
I'd have to see an example project to give you a diagnosis. Please see this FAQ: link
|
|
|
Post by jayantha on Dec 12, 2022 12:08:44 GMT
I found it .Problem solved.
|
|