【问题标题】:How to use Input.Text in SQLite where clause?如何在 SQLite where 子句中使用 Input.Text?
【发布时间】:2022-06-14 23:44:44
【问题描述】:

我希望用户能够输入某些内容,并且 where xxx = '' 可以在 '' 中获取输入。我的代码如下

            // SELECT sum(Artwork.worth) as totalGalleryWorth, Gallery.galleryName from Gallery INNER JOIN Artwork on Gallery.GalleryID = Artwork.galleryiD where Gallery.galleryName = 'CatLand';"
        dataManager.ArtworkAvgQuery("SELECT round(avg(Artwork.worth),2) as avgArtworkWorth, Gallery.galleryName from Gallery INNER JOIN Artwork on Gallery.GalleryID = Artwork.galleryiD where Gallery.galleryName = '\"" + Input.Text + "\"';");

        while (dataManager.queryResult.Read())
        {
            
            if (firstPass == true) { counter++; }

            Debug.WriteLine(dataManager.queryResult.GetDouble(0));
            Debug.WriteLine(dataManager.queryResult.GetString(1));
        }
        firstPass = false;
        dataManager.database.Close();   

它说序数为 NULL 并且崩溃,它不会让我这样做吗?我可以帮忙吗?

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: c# sqlite computer-science


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-29
  • 1970-01-01
  • 2017-04-14
  • 2012-12-05
  • 1970-01-01
  • 2013-05-28
相关资源
最近更新 更多