string dt = System.DateTime.Now.ToShortDateString();
string str_class = "select id,cla_time,cla_id,cla_type,cla_schedule,cla_topic,book_count from cla_daily where cla_time='" + dt + "'";SqlDataAdapter da = new SqlDataAdapter(str_class, conn);
DataSet ds = new DataSet();
da.Fill(ds);Repeater1.DataSource = ds;
Repeater1.DataBind();
现在我要根据book_count的值来绑定book_count字段, 如果book_count<8 绑定 “有位置” 否则绑定“满员”。请问需要怎样来写代码。
string str_class = "select id,cla_time,cla_id,cla_type,cla_schedule,cla_topic,book_count from cla_daily where cla_time='" + dt + "'";SqlDataAdapter da = new SqlDataAdapter(str_class, conn);
DataSet ds = new DataSet();
da.Fill(ds);Repeater1.DataSource = ds;
Repeater1.DataBind();
现在我要根据book_count的值来绑定book_count字段, 如果book_count<8 绑定 “有位置” 否则绑定“满员”。请问需要怎样来写代码。
解决方案 »
- sql语句,在线等
- 一个关于GRIDVIEW导出EXECL 郁闷的问题
- !如何取得方法中所有调用的类!
- 请问我开发程序的电脑安装的是64位的WINDOWS2003操作系统,服务器是32位的2003系统,我把我的程序放到服务器上会不会有问题???
- 如何自动触发menu的click事件?
- 玩过花生壳的朋友请进,输入sharplee82.vicp.net为什么会出现路由器的登录对话框啊?
- 老赵的AJAX视频课程全集下载地址Zz
- 请指教DATAGRID的超级链接列的问题?
- asp.net 怎么发送http post的请求
- 第一天学asp.net遇到的问题,谢谢~
- 即用JS又用验证控件,怎么用JS判断页面上的验证控件都通过了?
- asp.net后台控制table中的TD的样式
建议你定义一Model 类
在类内处理
private book_count;public string Book_count
{
get{return book_count<8?"有位置":"满员";}
set{book_count=value; }
}<%#Eval("Book_count")%>
{
get{return book_count<8?"有位置":"满员";}
}