代码
<asp:SqlDataSource
id="SqlDataSource1"
runat="server"
DataSourceMode="DataReader"
ConnectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Computer;user id=sa; pwd=''"
SelectCommand="select * from teacherandclass where 教师姓名= ">
</asp:SqlDataSource>
其中我要把SelectCommand中教师姓名的值在page_load中指名,应该怎么写?
<asp:SqlDataSource
id="SqlDataSource1"
runat="server"
DataSourceMode="DataReader"
ConnectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Computer;user id=sa; pwd=''"
SelectCommand="select * from teacherandclass where 教师姓名= ">
</asp:SqlDataSource>
其中我要把SelectCommand中教师姓名的值在page_load中指名,应该怎么写?
解决方案 »
- 简单正则问题,送分
- 后台代码前置问题
- 新年快到了,再祝大家新年快乐,人人有分,不够再加
- 调了两天就是着不出来有什么错,完全模仿微软petshop3.0的,请高人指点!
- 关于C#与VB共存于同一份ASP.NET2.0代码工程
- 怎样使按"取消"按纽的时候,不做RequiredFieldValidator校验.
- 关闭子窗体问题(急!)
- win平台下,IIS支持shtml吗
- 同一问题,不同ID:我上传图片到服务器的某个文件夹,如何保证不覆盖同名文件?
- 再问一下,在DataList中,使用修改编辑模板,在Update内容时,为何用Button来提交不能调用Sub,而用LinkButton就可以成功调用?
- 高手进:datagrid的网格是否可以拆分,像EXCEL里的"单元格拆分"一样?
- 怎么样才可以在事件里实现页面刷新呢?
id="SqlDataSource1"
runat="server"
DataSourceMode="DataReader"
ConnectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Computer;user id=sa; pwd=''"
SelectCommand="select * from teacherandclass where 教师姓名=@lookupPassword">
<SelectParameters>
<asp:Parameter Name="lookupPassword" Type="String" DefaultValue="" />
</SelectParameters>
我想温一下,我应该在那里设置lookupPassword的值?
>>>>>>>>
应该是从Url参数、Form表单元素或页面上控件的属性值等传递。
<SelectParameters>
<asp:QueryStringParameter Name="lookupPassword" Type="String" QueryStringField="name"
Type="String" />
</SelectParameters>