如何使用第一个,下一个,上一个和最后一个按钮以C#窗体形式从数据库中获取信息 [英] How to use first, next, previous and last button to fetch info from the database in C# windows form

查看:73
本文介绍了如何使用第一个,下一个,上一个和最后一个按钮以C#窗体形式从数据库中获取信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天请我有四个按钮,我希望他们将数据从数据库中提取到文本框以及图片显示在图片框中。并且文本框可以不可编辑,用户无法编辑文本框。谢谢



我尝试过:



i没有尝试任何我只知道如何使用datagridview

解决方案

引用:

文本框是不可编辑的

是 - 将ReadOnly属性设置为true:TextBoxBase.ReadOnly Property(System.Windows.Forms) [ ^ ]



我们无法告诉您如何操作按钮或准确显示图像 - 我们不知道您的数据库包含什么,甚至不知道它是什么类型的数据库(并且有很多)。但访问数据库和检索图像的基础知识如下:为什么我得到参数无效。我从数据库中读取图像时出现异常? [ ^ ]

它显示了从SQL Server DB获取图像的基本代码(其他人将会非常相似)


检查这些

第一个下一个上一个上一个按钮的代码,并在页面窗口中显示数据C#application [ ^ ]

如何使用Windows应用程序在文本框中显示记录为第一个 - 下一个 - 上一个 - 上一个 [ ^ ]

good day please i have four buttons please i want them to fetch data from the database to a textbox and also the image to show in the picturebox. And can a textbox be non editable, that a user cannot edit a textbox.thanks

What I have tried:

i haven't tried anything i only know how to use the datagridview

解决方案

Quote:

can a textbox be non editable

Yes - set the ReadOnly property to true: TextBoxBase.ReadOnly Property (System.Windows.Forms)[^]

We can't tell you how to do the buttons, or display an image exactly - we don't know what your DB contains, or even what type of DB it is (and there are many). But the basics of accessing a DB and retrieving an image are here: Why do I get a "Parameter is not valid." exception when I read an image from my database?[^]
It shows the basic code to fetch an image from an SQL Server DB (the others will be very similar)


check these
Code for first next last previous button and display data in page windows C# application[^]
How to Display Records as First-Next-Previous-Last in a Textboxes Using Windows Application[^]


这篇关于如何使用第一个,下一个,上一个和最后一个按钮以C#窗体形式从数据库中获取信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆