如何在Sql中获取所有数据库数据 [英] How to Fetch all database data in Sql

查看:83
本文介绍了如何在Sql中获取所有数据库数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建一个应用程序,在该应用程序中,我必须在C#NET中获取数据集中的所有数据,然后我将对该数据集执行所有事务操作.如果对我的问题有任何解决方案,请告诉我.

谢谢

Hi, I have to crated application in which I have to fetch all data in data-set in C#NET, And I will done all transaction operation on that data-set. If any have any solution over my question please update me.

Thanks

推荐答案

//编写存储过程以获取数据
如果您需要从多个表中获取数据,请使用连接

//填充数据集

//write a store procedure to fetch data
if you need to fetch the data''s from more than one table use joins

//To fill a dataset

SqlConnection con =new SqlConnection("");
SqlCommand cmd =new SqlCommand("sp name",con);
cmd.CommandTye=commandType.StoredProcedure;
SqlDataAdapter da=new SqlDataAdapter(cmd);
Dataset ds=new Dataset();
da.Fill(ds);


浏览以下链接,并练习示例

http://www.java2s.com/Code/CSharp/Database- ADO.net/CatalogDatabase-ADO.net.htm [ ^ ]

谢谢
--RA
Go through the below link, and practice the examples

http://www.java2s.com/Code/CSharp/Database-ADO.net/CatalogDatabase-ADO.net.htm[^]

Thanks
--RA


假设您要对数据集执行操作,我提供了以下链接,这些链接将帮助您入门.

http://msdn.microsoft.com/zh-CN /library/system.data.dataset(v=vs.71).aspx [ http://www.csharp-station.com/Tutorial/AdoDotNet/lesson05 [ ^ ]

为初学者使用ADO.NET [ http://www.dotnetperls.com/dataset [
Assuming you want to perform operations on dataset, I am providing following links which will help you in getting started.

http://msdn.microsoft.com/en-us/library/system.data.dataset(v=vs.71).aspx[^]

http://www.csharp-station.com/Tutorial/AdoDotNet/lesson05[^]

Using ADO.NET for beginners[^]

http://www.dotnetperls.com/dataset[^]


这篇关于如何在Sql中获取所有数据库数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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