vs2005中连接sql server2000 连接字符串
sqlconnection conn = new sqlconnection(sqlconn.connstring);
string sqltext = "select * from loginuser where (username='" + name + "') and (" + "userpwd='" + pwd + "')";
sqlcommand command = new sqlcommand(sqltext, conn);
//try
//{
conn.open();
//try to get the information and identification
//try
//{
sqldatareader datareader = command.executereader();//sqldatareader doesn't have a constructor
if (datareader.read() == true)
{
response.redirect("modellist.asp教程x");
}
else
{
response.redirect("logerr.aspx");
}
//}
//catch (system.exception exception)
//{
// response.redirect("syserr.aspx");
//}
conn.close();//}
//catch (system.exception excetion1)
//{
// response.redirect("opendatabaseerr.aspx");
//}
/*
vs2005中连接sql server2000 连接字符串2009-11-05 22:54private static string connstring = "server=(local);database=webdevelop;uid=sa;pwd=sa";
这里的(local)还可以是localhost或者127.0.0.1
从这里可以看出,应该写服务器的地址,由于是本地运行,而且在iis中绑定了127.0.0.1这个地址,所以写localhost和127.0.0.1都可以。另外,(local)是sql server 2000 中的服务器对象,所以也是可以的。如果在iis中将此网站设为默认网站,而且绑定地址169.254.218.201,则还可以这样连接:
private static string connstring = "server=169.254.218.201;database=webdevelop;uid=sa;pwd=sa";
如果是数据库教程在远程服务器上运行,则此处应该写远程服务器的ip地址。
另外,打开和读取数据库 中数据时,很容易抛出异常,所以不要经常捕捉,否则会出错
模拟极限越野
模拟极限越野开着大巴在各种奇葩路况里送乘客。山路弯道多得让人
模拟火车
模拟火车让你当回真正的火车司机,得先学会看信号灯、操作控制杆
可口的披萨美味的披萨
可口的披萨美味的披萨带您体验经营一家披萨店的乐趣。游戏画风温
定制虚拟偶像最新版
定制虚拟偶像最新版是一款超级经典有趣的日本模拟装扮类型的手游
病娇模拟器手机版正版(yandere simulator)
病娇模拟器最新版手游是一款萌妹二次元模拟游戏,玩家在游戏中可