如何在asp.net表中使用数据库显示数据,但代码是在c#visual中? [英] how to display data in database using in table of asp.net but the code are in c# visual?

查看:68
本文介绍了如何在asp.net表中使用数据库显示数据,但代码是在c#visual中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能给出你的意见吗?



或你的问题的答案?



谢谢

can u give ur opinion?

or your the answer of my question?

thanks

推荐答案

Gridview只不过是一张桌子。您可以使用它来显示来自数据库的数据。例如:

Gridview is nothing but just a table. You can use it to display data from database.Something like:
SqlConnection con = new SqlConnection("");//connection name
con.Open();
SqlCommand cmd = new SqlCommand("select * from table_name", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();



问候..:)


Regards..:)


或者像我们这里的帖子一样
or here like in our posting here


而且我也没有在这个

中使用datagrid,因为它是一个网站...它的右下页:)
and also i dont use datagrid in this
because it is a website ...it has next page right :)


这篇关于如何在asp.net表中使用数据库显示数据,但代码是在c#visual中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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