日期:2014-05-17  浏览次数:20450 次

用select取数据表里的数据值
DataClassesDataContext ctx = new DataClassesDataContext(); //数据源
  var xh = from b in ctx.stu_mark
  where b.name == Session["name"]
  select b.number;

  string c = xh.ToString();
  this.Label4.Text = c;


运行后label4显示的值是“SELECT [t0].[number] FROM [dbo].[stu_mark] AS [t0] WHERE [t0].[name] = @p0 ”,不是用户的number值。求大神帮忙取number的值

------解决方案--------------------
string c = xh.First().ToString();