使用数据源读取SQLServer数据库 [英] Reading SQLServer Database using Datasource
本文介绍了使用数据源读取SQLServer数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个数据源以与SQL数据库连接.当我将其与GridView连接时,它可以正常工作.我需要读取某些项目(例如FirstName)并将值存储到变量中.
如何使用此数据源?你能给我说一下吗?
谢谢
Hi,
I have created a datasource to connect with SQL Data Base. It works fine when I connected it with GridView. I need to read certain item (say FirstName) and store the value to a variable.
How can I use this datasource? Could you give me the statements for that?
Thanks
推荐答案
您的数据源名称为ds(say),
现在,您可以将特定值读取为:
You have got your Datasource by name ds(say),
Now, you can read the particular values as :
Dim FirstName As String = Convert.ToString(ds.Tables("TableEmp").Rows(0).Item("FirstName"))
我希望这可以解决您的查询.
阿努拉格(Anurag)
I hope this solves your query.
Anurag
这篇关于使用数据源读取SQLServer数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文