摘要:
一、没有异常处理代码的程序 //创建数据连接对象,连接Northwind数据库 SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Server=PC-2010;user id=sy2010;password=123456;Database=Northwind;"; //创建命令对象 SqlCommand cmd = new SqlCommand(); //设置命令对象的文本,表Customer本来是Customers,故意将s去掉的,以产生异常 cmd.CommandText = " 阅读全文
摘要:
using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Default2 : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { string strCon = "Data Source=ahxh-02;Initial Catalog=PubB... 阅读全文