数据库连接的问题!!!

netmailer 2002-05-27 11:09:15
我的程序是:private void Page_Load(object sender, System.EventArgs e)
{
string mys="select * from Company";
string myc="server=localhost;uid=sa;pwd=aaaa;database=aaaa";

SQLConnection myconn=new SQLconnection(myc);
SQLCommand mycomm=new SQLCommand(mys,myconn);
myconn.Open();
SQLDataReader myd;
myc.Execute(out myd);
show.DataSource=myd;
show.DataBind();
myd.close();
myconn.close();
// Put user code to initialize the page here
}

错误信息是:e:\inetpub\wwwroot\数据库\WebForm1.aspx.cs(27): The type or namespace name 'SQLCommand' could not be found (are you missing a using directive or an assembly reference?)
e:\inetpub\wwwroot\数据库\WebForm1.aspx.cs(25): The type or namespace name 'SQLConnection' could not be found (are you missing a using directive or an assembly reference?)


e:\inetpub\wwwroot\数据库\WebForm1.aspx.cs(29): The type or namespace name 'SQLDataReader' could not be found (are you missing a using directive or an assembly reference?)


...全文
43 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
chump 2002-05-28
  • 打赏
  • 举报
回复
是否:using System.Data;
using System.Data.SqlClient;
dreamdragon2008 2002-05-27
  • 打赏
  • 举报
回复
SQLCommand ->SqlCommand
SQLDataReader ->SqlDataReader
注意大小写

1,979

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧