本文介绍了从sql server中检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds ...

i在asp.net中创建一个网站并从sql server 2005中检索数据,它以页表格式表示如何完成请重放

谢谢...

hi frnds...
i make a web site in a asp.net and retrive data from the sql server 2005 and it's represent in page table format how it is done please replay
thanks...

推荐答案


string str = " select filename from tblFiles  ";

        //con.Ins_Upd_Del("insert into tblnews(title,description,date) values('"+txtTitle .Text +"','"+txtDescription .Text+"','"+txtDate .Text .Trim ()+"')");

        SqlConnection sqn = new SqlConnection(@"Data Source=MEHUL-PC\SQLEXPRESS;Initial Catalog=dbFiles;Integrated Security=True");
        sqn.Open();

        SqlCommand cmd = new SqlCommand(str, sqn);
       SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvUserInfo.DataSource = ds;
gvUserInfo.DataBind();


这篇关于从sql server中检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 21:37