想要使用SQL制作搜索功能,但从未使用过数据库
我制作了一个Winforms应用程序,该应用程序在DataGridView中显示了数据行。我想添加一个函数,该功能根据用户在文本框中输入的文本搜索特定行。我发现了使用SQL查询的示例,但是我没有从SQL数据库数据源构造我的DataGridView,我用字符串和INT手动填写每行。 < .com/uploadfile/1E050F/search-record-in-datagridview-c-sharp/
我是数据库的新手,我有一个概念上的问题。我可以在运行时创建一个临时数据库,而无需在系统上安装受密码保护的数据库吗?该程序是我作为.EXE文件与同事共享的程序,我不希望他们需要下载并安装带有特定用户名/密码的SQL数据库,以运行该程序。我不希望在程序退出时存储在数据库中的数据继续存在。我只想能够创建一个数据库并查询它,以便在程序实际运行时可以为我的DataGridView实现一个良好的搜索功能。我的程序基于用户提供的.txt日志文件在运行时生成全新的DataGridView,并且不需要数据在运行之间持续存在。
I made a Winforms application that displays rows of data in a DataGridView. I want to add a function that searches for specific rows based on text that the user enters in a Textbox. I have found examples that use SQL queries but I did not construct my DataGridView from an SQL database data source, I filled in each row manually one-by-one with strings and ints.
https://www.c-sharpcorner.com/UploadFile/1e050f/search-record-in-datagridview-C-Sharp/
I am new to databases and I have a conceptual question. Can I create a temporary database at runtime without needing to install a password-protected database onto my system? This program is one that I share with colleagues as an .exe file and I don't want them to need to download and install an SQL database with a specific username/password just to run the program. I don't want the data stored in the database to persist when the program exits. I just want to be able to create a database and query it so I can implement a good search function for my DataGridView while the program is actually running. My program generates a completely new DataGridView at runtime based on the .txt log file that the user provides and has no need for data to persist between runs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要程序背后的数据库即可过滤DataGridView。
Instead of generating the DataGrid directly:
You don't need a Database behind your program to filter your DataGridView.
Instead of generating the DataGrid directly: