ASP.net数据库查询,急…… - .NET技术 / ASP.NET
protected void btnEnter1_Click(object sender, EventArgs e)
{
string username = txtUserName.Text.Trim();
string strConnection = "Data Source=.;Initial Catalog=MySchool;User ID=sa;Password=guo";
string strSql = "select * from Student where LoginId='@username'";
SqlConnection conn = new SqlConnection(strConnection);
SqlCommand command = new SqlCommand();
command.CommandText = strSql;
command.Connection = conn;
SqlParameter param = new SqlParameter("@username", SqlDbType.VarChar, 30);
param.Value = username;
command.Parameters.Add(param);//添加参数
conn.Open();
SqlDataReader reader= command.ExecuteReader();
GridView2.DataSource = reader;
GridView2.DataBind();//进行数据绑定
reader.Close();
conn.Close();
conn.Dispose();
}为啥老是不出结果,请各位帮忙看看!
SQL code:
改成我这样就好了
protected void btnEnter1_Click(object sender, EventArgs e)
{
string username = txtUserName.Text.Trim();
string strConnection = "server=.;database=MySchool;uid=sa;pwd=guo";
string strSql = &
相关问答:
http://www.zgjhjy.com/Test/PrimaryTest/Index.aspx
就是类似以上的在线测试系统,需要有一个后台的,语言是asp的,数据库是access的,还需要能在后台对信息进行添删改查的。谢谢各位了。。。
程序真的很多,不知 ......
function CheckOpwd(){//验证用户名
var pwd=document.all.txtOpwd;
var div1=document.getElementById("divPwd");
if (pwd.value=="")
{
......
C# code:
SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
Microsoft JET Database Engine '80040e07'
标准表达式中数据类型不匹配。
\wwwroot\update.asp, line 20
--------------------------------------------------------------------------------
Ho ......
我用.net开发wap网站
1,我从工具箱里拖了两个link,这两个link会显示在两行,如果让这两个link处于同一行。
2,如何显示两个控件之间的空格问题。
跟wap有关吗?不太明白
友情帮顶。。。。。。。。。。
就 ......