我希望基于显示特定用户详细信息的用户登录检索并显示在网格控件中 [英] i want retrieve and display in a grid control based on user login displaying the paricular user details

查看:62
本文介绍了我希望基于显示特定用户详细信息的用户登录检索并显示在网格控件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过但我无法得到解决方案请给出一些正确的解决方案......请......

i tried but i could not get exect soluton please give some correct solution...pls......

推荐答案

string strConnectionString = ConfigurationManager.ConnectionStrings["ASPNETDBConnectionString1"].ConnectionString;

    SqlConnection myConnect = new SqlConnection(strConnectionString);

    string strCommandText = "SELECT date, starttime, endtime, planner FROM bookings WHERE UserId =@UserId";
    SqlCommand cmd = new SqlCommand(strCommandText, myConnect);
  cmd.Parameters.AddWithValue("@UserId", UserId);

    myConnect.Open();
    SqlDataReader reader = cmd.ExecuteReader();  
    myGridView.DataSource = reader;
    myGridView.DataBind();

    reader.Close();
    myConnect.Close();



来自 here [ ^ ]



-KR


from here[^]

-KR


这篇关于我希望基于显示特定用户详细信息的用户登录检索并显示在网格控件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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