如何使用session获取当前用户的信息

How to get current user's information using session

我在这行代码中遇到问题:

myCommands = New OdbcCommand("select * from customer where uname='" + Session("user") + "'", myConnections)

我这里的目标是在一个页面选项卡中显示所有用户的信息,但它只显示一个空白页面。

发布我的评论作为答案:

myCommands = New OdbcCommand("select * from customer where lower(uname) = lower(@user)"), myConnections); 
myCommands.Parameters.Add("@user", OdbcDbType.NVarChar).Value = Session["user"].ToString();

这解决了一个问题。