如何从sql本地数据库(.mdf文件)中检索数据到文本框中 [英] how to retrieve data from sql local database(.mdf file) into a textbox

查看:79
本文介绍了如何从sql本地数据库(.mdf文件)中检索数据到文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请我创建一个应用程序,并希望将我数据库中某个单元格的值检索到我主表单上的文本框中。

please i am creating an application, and will like to retrieve the value of a certain cell in my database into my textbox on my main form.

数据库是一个本地sql数据库(.mdf文件),表调用TOTAL MEMBERSHIP和五列

the database is a local sql database (.mdf file) with a table call TOTAL MEMBERSHIP and five columns

数据库的连接字符串:Data Source =(LocalDB)\ MSSQLLocalDB; AttachDbFilename =" D:\\ \\ LIBRARY \ACADEMIC& Education\PROJECTS\I.T\VISUAL BASIC\A.C.C.M.S\LOCAL DATABASE FOR ACCMS.mdf" ;; Integrated Security = True

connectionstring for the database:Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="D:\LIBRARY\ACADEMIC & EDUCATION\PROJECTS\I.T\VISUAL BASIC\A.C.C.M.S\LOCAL DATABASE FOR ACCMS.mdf";Integrated Security=True

1。 ID

2。 TOTAL MEN

2. TOTAL MEN

3。总计女性

4。总儿童

5。 TOTAL CONGREGATION

5. TOTAL CONGREGATION

它只是一个行表,我只想在主页加载时在总会众中重视要检索到我的文本。

it is just one row table, i just want to value in the total congregation to be retrieve into my text when the main page loads.

文本框的名称是TEXTBOX1

the name of the text box is TEXTBOX1

推荐答案

您好NANA POKU BREMPONG,

Hi NANA POKU BREMPONG,

感谢您发布此处。

此论坛与Visual Studio IDE有关,因为您的问题与

ADO.NET DataSet
,我们帮助您将其移至正确的论坛以获得更好的支持。

This forum is about the Visual Studio IDE, as your issue is more related to the ADO.NET DataSet, we help you move it to correct forum for better support.

如果您有一些VS IDE问题,请随时与我们联系。我们将尽力为您提供解决方案。

If you have some VS IDE questions, please feel free to contact us. We will try our best to give you a solution.

感谢您的理解与合作。


这篇关于如何从sql本地数据库(.mdf文件)中检索数据到文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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